使用密码登陆Amazon EC2而不是私有密钥

创建instance后,会有一个pem的key
使用该密钥登陆到服务器上后,默认用户名为
ec2-user
直接修改root密码
$sudo passwd root
重复输入密码
 
然后切换到root
$su -
#
修改/etc/ssh/sshd_config
找到 PasswordAuthentication no,把no改成yes
接下来,要重新启动下sshd
/sbin/service sshd restart
 
再为原来的”ec2-user”添加登录密码。如下命令:
passwd ec2-user
按提示,两次输入密码。


http://tech.cncms.com/web/qita/94924.html

你可能感兴趣的:(亚马逊云AWS)