_LHH_
_LHH_
  • 发布:2018-03-07 11:27
  • 更新:2020-04-27 08:59
  • 阅读:5763

sftp连接失败:No suitable key exchange algorithm could be agreed;

分类:HBuilder
FTP

以前连接是没有问题的,换了个ip地址就会报整错。求大佬救助一下

2018-03-07 11:27 负责人:无 分享
已邀请:
Oli

Oli

遇到相同问题,如何解决?

t***@qq.com

t***@qq.com

需要直接在服务器(我用的是Ubuntu)中找到此文件: /etc/ssh/sshd_config

并且在最后添加以下两行代码:

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,blowfish-cbc,aes128-cbc,3des-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc

KexAlgorithms=curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
保存

重启SSH:
service sshd restart
即可

l***@qq.com

l***@qq.com - 90后程序员

我的操作系统是ubutu-18.0.4 配置之后重新sshd报错

root@litong-Inspiron-3458:~# systemctl restart sshd  
Job for ssh.service failed because the control process exited with error code.  
See "systemctl status ssh.service" and "journalctl -xe" for details.  
root@litong-Inspiron-3458:~# systemctl sttus sshd  
Unknown operation sttus.  
root@litong-Inspiron-3458:~# systemctl status sshd  
● ssh.service - OpenBSD Secure Shell server  
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)  
   Active: failed (Result: exit-code) since Mon 2020-04-27 08:54:49 CST; 11s ago  
  Process: 21464 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)  
  Process: 21461 ExecReload=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)  
  Process: 820 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=0/SUCCESS)  
  Process: 32061 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=255)  
 Main PID: 820 (code=exited, status=0/SUCCESS)  

4月 27 08:54:49 litong-Inspiron-3458 systemd[1]: ssh.service: Service hold-off time over, scheduling restart.  
4月 27 08:54:49 litong-Inspiron-3458 systemd[1]: ssh.service: Scheduled restart job, restart counter is at 5.  
4月 27 08:54:49 litong-Inspiron-3458 systemd[1]: Stopped OpenBSD Secure Shell server.  
4月 27 08:54:49 litong-Inspiron-3458 systemd[1]: ssh.service: Start request repeated too quickly.  
4月 27 08:54:49 litong-Inspiron-3458 systemd[1]: ssh.service: Failed with result 'exit-code'.  
4月 27 08:54:49 litong-Inspiron-3458 systemd[1]: Failed to start OpenBSD Secure Shell server.

ubuntu-18.0.4 该如何配置

该问题目前已经被锁定, 无法添加新回复