切换root权限
sudo -i
CentOS和Debian利用以下命令开启:
sed -i ‘s/PermitRootLogin no/PermitRootLogin yes/g’ /etc/ssh/sshd_config
sed -i ‘s/PasswordAuthentication no/PasswordAuthentication yes/g’ /etc/ssh/sshd_config
Ubuntu系统采用以下命令:
sed -i ‘s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g’ /etc/ssh/sshd_config
sed -i ‘s/PasswordAuthentication no/PasswordAuthentication yes/g’ /etc/ssh/sshd_config
设置Root登陆密码
passwd root
重启sshd服务
service sshd restart
利用reboot重启VM实例即可.