windows用SSH和linux同步文件linux开启SSHssh client 报 algorithm negoti

时间:2022-02-19 01:07:40

标签:

1、安装、配置与启动

SSH分客户端openssh-client和openssh-server 如果你只是想登陆别的机器的SSH只需要安装openssh-client(ubuntu有默认安装,如果没有则sudo apt-get install openssh-client),如果要使本机开放SSH服务就需要安装openssh-server

sudo apt-get install openssh-server

然后确认sshserver是否启动了:

ps -e |grep ssh

如果看到sshd那说明ssh-server已经启动了。

如果没有则可以这样启动:

sudo /etc/init.d/ssh start

ssh-server配置文件位于/ etc/ssh/sshd_config,在这里可以定义SSH的服务端口,默认端口是22,你可以自己定义成其他端口号,如222,这里要把PermitRootLogin的属性改为yes。

sudo gedit /etc/ssh/sshd_config

然后重启SSH服务:

sudo /etc/init.d/ssh restart

然后使用以下方式登陆SSH:

① 命令行方式:

ssh [email protected] username为192.168.1.112 机器上的用户,需要输入密码。

② 客户端方式:

windows用SSH和linux同步文件linux开启SSHssh client 报 algorithm negoti

2、问题与解决

ssh client 报 algorithm negotiation failed的解决方法之一

修改sshd的配置文件 /etc/ssh/sshd_config

在配置文件中添加:

Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,hmac-sha1-96,hmac-md5-96 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,[email protected]

重启sshd服务后,即可正常连接。

导致此问题的原因是ssh升级后,为了安全,默认不再采用原来一些加密算法,,我们手工添加进去即可。

windows用SSH和linux同步文件&linux开启SSH&ssh client 报 algorithm negotiation failed的解决方法之一