2014-10-26 83 views
12

我目前正在使用Aptana Studio 3.6.1(使用一些PHP語法修復的自定義構建)。我使用SFTP將項目中的文件上傳到測試站點,使用發佈工具(項目頂部的上傳/下載箭頭)。Aptana SFTP密鑰交換

最近,我變得無法上傳文件。 WinSCP能夠做到這一點,並且在使用PuTTY或普通的舊式OpenSSH時,我可以毫無問題地進入服務器。集錦,然而,拋出一個適合:

Failed to upload file 
Establishing SFTP connection failed: No suitable key exchange algorithm could be agreed. 
No suitable key exchange algorithm could be agreed. 

在auth.log相應的錯誤(與LogLevel的DEBUG1):

Oct 26 14:42:42 dedi sshd[13690]: debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8 
Oct 26 14:42:42 dedi sshd[13690]: debug1: inetd sockets after dupping: 3, 3 
Oct 26 14:42:42 dedi sshd[13690]: Connection from [My IP] port 24321 on [Server IP] port 22 
Oct 26 14:42:42 dedi sshd[13690]: debug1: Client protocol version 2.0; client software version edtFTPjPRO-4.1.0 
Oct 26 14:42:42 dedi sshd[13690]: debug1: no match: edtFTPjPRO-4.1.0 
Oct 26 14:42:42 dedi sshd[13690]: debug1: Enabling compatibility mode for protocol 2.0 
Oct 26 14:42:42 dedi sshd[13690]: debug1: Local version string SSH-2.0-OpenSSH_6.7p1 Debian-2 
Oct 26 14:42:42 dedi sshd[13690]: debug1: permanently_set_uid: 102/65534 [preauth] 
Oct 26 14:42:42 dedi sshd[13690]: debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256 [preauth] 
Oct 26 14:42:42 dedi sshd[13690]: debug1: SSH2_MSG_KEXINIT sent [preauth] 
Oct 26 14:42:42 dedi sshd[13690]: debug1: SSH2_MSG_KEXINIT received [preauth] 
Oct 26 14:42:42 dedi sshd[13690]: debug1: kex: client->server 3des-cbc hmac-sha1 none [preauth] 
Oct 26 14:42:42 dedi sshd[13690]: debug1: kex: server->client 3des-cbc hmac-sha1 none [preauth] 
Oct 26 14:42:42 dedi sshd[13690]: fatal: Unable to negotiate a key exchange method [preauth] 

我要指出,我已經用的sshd_config打亂周圍,以修復Aptana使用的某些密碼套件未在服務器上設置的早期錯誤。我懷疑這個問題與密鑰交換密碼套件有關,但我不確定如何調試該問題以確定要添加哪些套件。

$ uname -a && lsb_release -a 
Linux dedi 3.14-2-amd64 #1 SMP Debian 3.14.15-2 (2014-08-09) x86_64 GNU/Linux 
No LSB modules are available. 
Distributor ID: Debian 
Description: Debian GNU/Linux testing (jessie) 
Release:  testing 
Codename:  jessie 

回答

13

請使用DEBUG3級別。然後您將看到服務器上配置的密鑰交換算法列表以及客戶端支持的列表。

然後將下面的行添加到您的/ etc/SSH/sshd_config中:

KexAlgorithms <here comma-separated list of Kex Algorithms configured on your server>,<here one of the Kex Algorithms supported by your client> 

例如,OpenSSH的6.7已經默認激活以下算法:curve25519-SHA256 @ libssh.org,ECDH-SHA2 -nistp256,ECDH-SHA2-nistp384,ECDH-SHA2-nistp521,的Diffie-Hellman羣交換-SHA256,的Diffie-Hellman-group14-SHA1。

如果您的客戶端僅支持的Diffie-Hellman-組1-SHA1,那麼你的/ etc/SSH/sshd_config中應該包含

KexAlgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1. 

這是確定的 - OpenSSH的v.6.7不支持的Diffie-Hellman-組1-SHA1但是,它默認關閉。您應該允許sshd通過將KexAlgorithms行放到您的sshd配置中來使用此密鑰交換算法。

+0

謝謝。事實證明,客戶端只支持diffie-hellman-group1-sha1。 – 2014-10-27 19:44:57

+3

如果有人像我一樣絆倒了這一點,上面的KexAlgorithms對於Android應用ES文件瀏覽器至少需要使用JSCH-0.1.44(Java SSH2客戶端)的版本3.2.3是必需的。 – micah94 2014-11-25 04:52:36

+0

KexAlgorithms中列出的這些鍵優先嗎? – 2015-08-01 20:04:14

9
  1. 在遠程服務器上編輯的sshd_config採取:

    納米的/ etc/ssh/sshd_config

  2. 添加下列行:

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],[email protected],blowfish-cbc,aes128-cbc,3des-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc

[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

  • 重啓ssh服務
  • #/etc/init.d/ssh restart

    thx to

    +0

    這個答案也適用於phpDesigner 8.1.2 – SteB 2015-12-02 08:40:53