1、密码错误
建议重装,最为简单
2、ip配置有问题
解决办法:重新固定或修改IP
[root@rhce ~]# nmcli c modify ens160 ipv4.addresses 192.168.220.131/24 ipv4.gateway 192.168.220.2 ipv4.dns 114.114.114.114 ipv4.method manual autoconnect yes
[root@rhce ~]# nmcli c up ens160
3、VMware中ssh不允许连接
解决办法
[root@rhce ~]# cd /etc/ssh
[root@rhce ssh]# ls -l
total 600
-rw-r--r--. 1 root root 578094 Sep 23 2022 moduli
-rw-r--r--. 1 root root 1921 Sep 23 2022 ssh_config
drwxr-xr-x. 2 root root 28 Sep 23 00:14 ssh_config.d
-rw-------. 1 root root 3667 Sep 23 2022 sshd_config
drwx------. 2 root root 28 Sep 23 00:16 sshd_config.d
-rw-r-----. 1 root ssh_keys 492 Sep 23 11:48 ssh_host_ecdsa_key
-rw-r--r--. 1 root root 162 Sep 23 11:48 ssh_host_ecdsa_key.pub
-rw-r-----. 1 root ssh_keys 387 Sep 23 11:48 ssh_host_ed25519_key
-rw-r--r--. 1 root root 82 Sep 23 11:48 ssh_host_ed25519_key.pub
-rw-r-----. 1 root ssh_keys 2578 Sep 23 11:48 ssh_host_rsa_key
-rw-r--r--. 1 root root 554 Sep 23 11:48 ssh_host_rsa_key.pub
[root@rhce ssh]# vim sshd_config
找到 #PermitRootLogin prohibit-password
并将其修改为 PermitRootLogin yes
重启ssh服务 [root@rhce ssh]# systemctl restart sshd
再重新连接即可解决