服务器默认使用秘钥方式登录,有些麻烦,所以切换成密码登录,具体方式如下
sudo -i // 使用opc用户登录后切换root
echo root:要登录的密码 |sudo chpasswd root // 修改root的密码
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config; // 开启root登录
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config; // 开启密码验证
service sshd restart // 重启ssh服务
文章介绍了如何将Linux服务器的默认密钥登录方式改为密码登录,包括步骤如切换到root用户,修改root密码,开启PermitRootLogin和PasswordAuthentication选项,以及重启ssh服务以应用更改。
1万+

被折叠的 条评论
为什么被折叠?



