我想调整ubuntu云版本默认设置,其中拒绝root登录。
尝试连接到这样的机器会产生:
maxim@maxim-desktop:~/workspace/integration/deployengine$ ssh root@ec2-204-236-252-95.compute-1.amazonaws.com
The authenticity of host 'ec2-204-236-252-95.compute-1.amazonaws.com (204.236.252.95)' can't be established.
RSA key fingerprint is 3f:96:f4:b3:b9:4b:4f:21:5f:00:38:2a:bb:41:19:1a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ec2-204-236-252-95.compute-1.amazonaws.com' (RSA) to the list of known hosts.
Please login as the ubuntu user rather than root user.
Connection to ec2-204-236-252-95.compute-1.amazonaws.com closed.
我想知道在哪个配置文件中通过ssh进行的根阻止配置以及如何更改打印的消息?
/root/.ssh/authorized_keys
在形式中 添加一行no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"ubuntu\" rather than the user \"root\".';echo;sleep 10" ssh-rsa xxxxxx
。因此,即使PermitRootLogin yes
ssh命令将无法获得有效的shell。