how to login in EC2 instance with non ec2-user?

view full story

http://serverfault.com – How to login with non ec2-user account in amazon linux ami? #useradd -m sample #passwd sample set password #cat /etc/passwd sample:x:508:1002::/home/monitor/sample:/bin/bash # cat /home/monitor/sample/.ssh/authorized_keys command="echo 'Please login as the ec2-user user rather than root user.';echo;sleep10" ssh-rsa xxxxxxxxx # chown -R sample /home/monitor/sample/.ssh I copied /root/.ssh/authorized_keys to the new user's .ssh directory also At login time server says 'server refused our key' and no supported authentication method available popup. How to associate sample with my exist (HowTos)