ec2加root账号密码登录

sudo passwd root
两遍密码
sudo sed -i 's/^.*PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/^.*PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
sudo /bin/systemctl restart sshd.service

 

posted @ 2022-04-27 19:40  rootoor  阅读(64)  评论(0)    收藏  举报