首先贴出错误原因,sshsecureshell连接Linux时提示server responded "algorithm negotiation failed”的原因是Linux下ssh服务的加密算法错误
sshsecureshell是Windows下连接使用ssh连接Linux的一个非常实用的工具,但是使用sshsecureshell登录Linux系统之前需要进行配置,在Linux下安装SSH服务,本教程以sshsecureshell连接ubuntu20.04为例讲解如何使用sshsecureshell
1、ubuntu下安装SSH服务并配置允许远程登录
依次输入以下命令,安装ssh服务
sudo apt-get update
sudp apt-get upgrade
sudo spt-get install openssh-server
配置ssh,修改/etc/ssh/sshd_config文件
实用vi打开配置文件,修改PermitRootLogin prohibit-password为PermitRootLogin yes
如下图
重启ssh服务,使用命令
sudo service ssh restart
sudo service ssh restart
此时SSH服务就已经打开了,可以使用ssh工具远程登录ubuntu,但是使用sshsecureshell登录ubuntu还需要进行配置
2、使用sshsecureshell登录ubuntu
连接步骤如下图
Host Name是ubuntu的IP地址
user Name是ubuntu的用户名,选择root或其他用户都可以
port是ssh服务的端口,不需要修改
Authentication是身份验证,选择Password
此时会出现错误就是我们标题的错误**server responded "algorithm negotiation failed”**见下图
原因是ssh服务的加密方式有问题,下面来解决这个问题
3、如何解决server responded "algorithm negotiation failed
出现这个问题要修改/etc/ssh/sshd_config文件,在配置文件的最后添加如下内容,添加之后如下图
Ciphers 3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com
MACs hmac-sha1,hmac-sha1-96,hmac-sha2-256,hmac-sha2-512,hmac-md5,hmac-md5-96,umac-64@openssh.com,umac-128@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-md5-etm@openssh.com,hmac-md5-96-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org
使用sudo service ssh restart重启ssh服务,如果不报错就按照第二步的方法连接即可,如果如果报错为
**Job for ssh.service failed because the control process exited with error code.See “systemctl status ssh.service” and “journalctl -xe” for details.**请查看我的另一篇博客内容
https://blog.csdn.net/qq_45120255/article/details/120459204
重启SSH服务的命令
重启SSH服务的命令
sudo service ssh restart