服务器只能key登陆,用这个后直接可以root方式登陆
sudo -i echo root:要设置的密码 |sudo chpasswd 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 service sshd restart
标签:sshd,sudo,一键,PasswordAuthentication,PermitRootLogin,登陆,linux,root From: https://www.cnblogs.com/devilx/p/17030859.html