出现提示:
Connecting to 192.168.169.111:22…
Connection established.
To escape to local shell, press ‘Ctrl+Alt+]’.
Escape to local shell… To return to remote host, enter “exit”.
To close connection, enter “disconnect”.
Type `help’ to learn how to use Xshell prompt.
好多人遇到过本地连接虚拟机Xshell连接不上的问题,网上查了一下遇到这个问题的几种解决方案。
linux端命令
(1)vi /etc/ssh/sshd_config;
(2)i(编辑模式);
(3)找到UseDNS yes,改为UseDNS no;
(4)最后保存退出,重启sshd:systemctl restart sshd
如果后续登录还出现下面报错:
Connecting to 192.168.132.79:22...
Could not connect to '192.168.132.79' (port 22): Connection failed.
执行以下命令
chown root:root /var/empty/sshd
chmod 755 /var/empty/sshd
systemctl restart sshd