xshell链接Ubuntu20.04
Xshell是一个安全终端模拟软件,可以进行远程登录。我使用XShell的主要目的是在Windows环境下登录虚拟机Ubuntu,用于学习Python。
1、下载安装xshell客户端,在安装时可以选择个人/学校免费版,这样不需要付费。
2、更新系统
sudo apt update
3、安装完成之后,如果你直接连接Ubuntu主机会发现连接不上,这是因为Ubuntu主机没有开启SSH服务,需要开启openssh-server:
sudo apt-get install openssh-server
查看sshd服务是否开启
ps -e | grep ssh
启动sshd
systemctl start ssh
4、如果还是链接不上,报错:
error: kex protocol error: type 30 seq 1 [preauth]
输入systemctl status ssh查询ssh状态
还不能使用时,使用
vim /etc/ssh/sshd_config
在文件末尾增加
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1
输入systemctl restart ssh重启ssh