一 如果登陆ssh出现要求输入公钥信息,去掉密钥验证,进行如下操作:
sed -ie 's/AuthorizedKeysFile .ssh\/authorized_keys/#AuthorizedKeysFile .ssh\/authorized_keys/g' /etc/ssh/sshd_config
sed -ie 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
sed -ie 's/GSSAPIAuthentication yes/#GSSAPIAuthentication yes/g' /etc/ssh/sshd_config
systemctl restart sshd
二 修改root密码
(echo "xxx_123456";sleep 1;echo "xxx_123456") | passwd > /dev/null
上述脚本:密码不能出现特殊字符