2013年12月31日 星期二

user specific sshd config

When ssh to some AWS EC2 AMI such as RedHat , Amazon Linux and Ubuntu, ssh will prompt some message like below:

Please login as the user "ec2-user" rather than the user "root".

The secret is here:

# cat /root/.ssh/authorized_keys
no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"ec2-user\" rather than the user \"root\".';echo;sleep 10"

Summary:
You can define user-specific sshd config in ~/.ssh/authorized_keys file


沒有留言:

張貼留言