一、使用密钥登陆
- 服务器ssh窗口登陆
- xshell密钥登陆(或者)
二、修改为用户登陆
2.1、修改root密码
sudo -i
sudo passwd root
然后输入两次密码
2.2、修改centos登录方式为密码登录
打开配置文件 /etc/ssh/sshd_config
PermitRootLogin yes
PubkeyAuthentication no (也可用#号注释)
PasswordAuthentication yes
2.3、重启sshd服务
systemctl restart sshd
or
service sshd restart
评论区