FileZilla,' sftp' Linux上的命令无法连接到特定服务器。 SSH有效,在Windows上一切正常

时间:2015-11-15 21:41:09

标签: ssh sftp filezilla

我有一个特定的服务器(让我们称之为some.server.com)我的不是管理员,但是我已经有一个启用了SSH的用户帐户(它适用于使用PuTTY的Windows和使用默认ssh命令的Linux),我想使用SFTP协议访问它。

在Windows上,一切都可以使用FileZilla。我配置了user@some.server.com并在询问时输入密码。我确实必须更改"高级 - >默认远程目录"但是,要/(或我的主目录的完整路径)才能工作。如果我不这样做,它就会退出:

Command:   pwd
Response:  Current directory is: "."
Error:     Failed to parse returned path.
Error:     Failed to retrieve directory listing.

我认为这是由于服务器中的一些奇怪的错误配置造成的。

在Linux(Linux Mint 17.2)上,没有任何作用。 FileZilla挂起open "user@some.server.com" 22,然后超时。如果我打开调试输出,会发生以下情况:

Command:    open "user@some.server.com" 22
Trace:  Server version: SSH-2.0-OpenSSH_6.9p1-hpn14v5
Trace:  Using SSH protocol version 2
Trace:  We claim version: SSH-2.0-PuTTY_Local:_Sep_14_2013_01:12:43
Trace:  Doing Diffie-Hellman group exchange
** About 30 seconds go by **
Error:  Connection timed out
Trace:  CControlSocket::DoClose(2050)
Trace:  CSftpControlSocket::ResetOperation(2114)
Trace:  CControlSocket::ResetOperation(2114)
Error:  Could not connect to server

我认为这可能是FileZilla安装的问题,但它适用于我尝试过的所有其他服务器(包括我的个人服务器)。我仔细检查过,当连接到同一台服务器时,Windows会执行ECDH密钥交换,而不是像此跟踪中的DH那样。也许这就是问题所在?

我也尝试使用sftp命令。它连接并询问我的密码。我输入它,然后退出并出现此错误:

sftp user@some.server.com
Password: ** I enter my password **
Connected to some.server.com.
Couldn't canonicalize: No such file or directory
Need cwd

我认为这与FileZilla在Windows上的错误相同,所以我尝试了sftp user@some.server.com:/命令,但我遇到了同样的错误。

我已经通过电子邮件与管理员进行了交谈,而且我是第一个报告此类问题的人。他们认为我的配置可能有些问题,并希望我亲自到他们的办公室帮忙解决问题。事实是,这是一个桌面,我目前没有安装Linux的笔记本电脑,我可以测试它。我实际上是想在我的Windows笔记本电脑上安装VirtualBox进行仔细检查,但我还没有找到时间。

有什么想法吗?感谢。

编辑1:WinSCP日志

. 2015-11-16 19:40:25.018 Session name: user@some.server.com (Ad-Hoc site)
. 2015-11-16 19:40:25.018 Host name: some.server.com (Port: 22)
. 2015-11-16 19:40:25.019 User name: user (Password: Yes, Key file: No)
. 2015-11-16 19:40:25.019 Tunnel: No
. 2015-11-16 19:40:25.019 Transfer Protocol: SFTP (SCP)
. 2015-11-16 19:40:25.019 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2015-11-16 19:40:25.019 Disable Nagle: No
. 2015-11-16 19:40:25.019 Proxy: none
. 2015-11-16 19:40:25.019 Send buffer: 262144
. 2015-11-16 19:40:25.019 SSH protocol version: 2; Compression: No
. 2015-11-16 19:40:25.019 Bypass authentication: No
. 2015-11-16 19:40:25.019 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2015-11-16 19:40:25.019 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2015-11-16 19:40:25.019 KEX: dh-gex-sha1,dh-group14-sha1,dh-group1-sha1,rsa,WARN
. 2015-11-16 19:40:25.019 SSH Bugs: A,A,A,A,A,A,A,A,A,A,A,A
. 2015-11-16 19:40:25.019 Simple channel: Yes
. 2015-11-16 19:40:25.019 Return code variable: Autodetect; Lookup user groups: A
. 2015-11-16 19:40:25.019 Shell: default
. 2015-11-16 19:40:25.019 EOL: 0, UTF: 2
. 2015-11-16 19:40:25.019 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2015-11-16 19:40:25.019 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2015-11-16 19:40:25.019 SFTP Bugs: A,A
. 2015-11-16 19:40:25.019 SFTP Server: default
. 2015-11-16 19:40:25.019 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2015-11-16 19:40:25.019 Cache directory changes: Yes, Permanent: Yes
. 2015-11-16 19:40:25.019 DST mode: 1
. 2015-11-16 19:40:25.019 --------------------------------------------------------------------------
. 2015-11-16 19:40:25.095 Looking up host "some.server.com"
. 2015-11-16 19:40:25.099 Connecting to X.X.X.X port 22
. 2015-11-16 19:40:27.305 Selecting events 63 for socket 1172
. 2015-11-16 19:40:27.307 Waiting for the server to continue with the initialization
. 2015-11-16 19:40:27.307 Looking for incoming data
. 2015-11-16 19:40:27.307 Looking for network events
. 2015-11-16 19:40:27.307 Detected network event
. 2015-11-16 19:40:27.307 Enumerating network events for socket 1172
. 2015-11-16 19:40:27.307 Enumerated 18 network events making 18 cumulative events for socket 1172
. 2015-11-16 19:40:27.307 Handling network write event on socket 1172 with error 0
. 2015-11-16 19:40:27.307 Handling network connect event on socket 1172 with error 0
. 2015-11-16 19:40:27.307 Looking for network events
. 2015-11-16 19:40:27.331 Detected network event
. 2015-11-16 19:40:27.331 Enumerating network events for socket 1172
. 2015-11-16 19:40:27.331 Enumerated 1 network events making 1 cumulative events for socket 1172
. 2015-11-16 19:40:27.331 Handling network read event on socket 1172 with error 0
. 2015-11-16 19:40:27.331 Server version: SSH-2.0-OpenSSH_6.9p1-hpn14v5
. 2015-11-16 19:40:27.331 Using SSH protocol version 2
. 2015-11-16 19:40:27.331 We claim version: SSH-2.0-WinSCP_release_5.7.6
. 2015-11-16 19:40:27.331 Waiting for the server to continue with the initialization
. 2015-11-16 19:40:27.332 Looking for incoming data
. 2015-11-16 19:40:27.332 Looking for network events
. 2015-11-16 19:40:27.348 Detected network event
. 2015-11-16 19:40:27.348 Enumerating network events for socket 1172
. 2015-11-16 19:40:27.348 Enumerated 1 network events making 1 cumulative events for socket 1172
. 2015-11-16 19:40:27.348 Handling network read event on socket 1172 with error 0
. 2015-11-16 19:40:27.348 Using Diffie-Hellman with standard group "group14"
. 2015-11-16 19:40:27.348 Doing Diffie-Hellman key exchange with hash SHA-1
. 2015-11-16 19:40:27.395 Waiting for the server to continue with the initialization
. 2015-11-16 19:40:27.395 Looking for incoming data
. 2015-11-16 19:40:27.395 Looking for network events
. 2015-11-16 19:40:27.424 Detected network event
. 2015-11-16 19:40:27.425 Enumerating network events for socket 1172
. 2015-11-16 19:40:27.425 Enumerated 1 network events making 1 cumulative events for socket 1172
. 2015-11-16 19:40:27.425 Handling network read event on socket 1172 with error 0
. 2015-11-16 19:40:27.491 Verifying host key rsa2 0x10001,0xa3b26aa134c3f969 4052dfe9a1ec42d7 310b92bcac0703ad c318ecf305d516a4 8b56cbd1d737d058 2c8de0d374ae84ed e59afe086462b068 47935368373deeca 5db04cceefbfb6e8 0b4176041e1ffc74 a729a23421d6ad97 45e9101fab34399f 103e3f3567612029 d672a215feda64fd 93de6a5cfb59d69e 0e383e6e0e332f58 a835944076e5b952 947521b8d6b7cc92 9c9758b73211928b a6eade34dfc79617 b8ae9a4743abfad0 12fd52a5fc36aaaf 705058885fe8a557 48d691f6c5bdf6fc 1c9d494f4505f4d6 d9dc01802dec6cf7 79193e2b7c7c948c 8ce04556750adf05 06a401f5f05cefcd 4c492a48c97144ee 8a724204641faba0 b4dd9e1d9f0760cd  with fingerprint ssh-rsa 2048 40:71:a0:95:ed:0a:ac:5c:26:8c:ed:c9:7b:ac:a1:47
. 2015-11-16 19:40:27.509 Host key matches cached key
. 2015-11-16 19:40:27.509 Selecting events 63 for socket 1172
. 2015-11-16 19:40:27.509 Host key fingerprint is:
. 2015-11-16 19:40:27.509 ssh-rsa 2048 40:71:a0:95:ed:0a:ac:5c:26:8c:ed:c9:7b:ac:a1:47
. 2015-11-16 19:40:27.509 Initialised AES-256 SDCTR client->server encryption
. 2015-11-16 19:40:27.509 Initialised HMAC-SHA-256 client->server MAC algorithm
. 2015-11-16 19:40:27.509 Initialised AES-256 SDCTR server->client encryption
. 2015-11-16 19:40:27.509 Initialised HMAC-SHA-256 server->client MAC algorithm
. 2015-11-16 19:40:27.509 Waiting for the server to continue with the initialization
. 2015-11-16 19:40:27.509 Looking for incoming data
. 2015-11-16 19:40:27.509 Looking for network events
. 2015-11-16 19:40:27.605 Detected network event
. 2015-11-16 19:40:27.605 Enumerating network events for socket 1172
. 2015-11-16 19:40:27.605 Enumerated 1 network events making 1 cumulative events for socket 1172
. 2015-11-16 19:40:27.605 Handling network read event on socket 1172 with error 0
! 2015-11-16 19:40:27.605 Using username "user".
. 2015-11-16 19:40:27.613 Waiting for the server to continue with the initialization
. 2015-11-16 19:40:27.613 Looking for incoming data
. 2015-11-16 19:40:27.613 Looking for network events
. 2015-11-16 19:40:27.641 Detected network event
. 2015-11-16 19:40:27.641 Enumerating network events for socket 1172
. 2015-11-16 19:40:27.641 Enumerated 1 network events making 1 cumulative events for socket 1172
. 2015-11-16 19:40:27.641 Handling network read event on socket 1172 with error 0
. 2015-11-16 19:40:27.641 Attempting keyboard-interactive authentication
. 2015-11-16 19:40:27.641 Waiting for the server to continue with the initialization
. 2015-11-16 19:40:27.641 Looking for incoming data
. 2015-11-16 19:40:27.641 Looking for network events
. 2015-11-16 19:40:27.931 Detected network event
. 2015-11-16 19:40:27.931 Enumerating network events for socket 1172
. 2015-11-16 19:40:27.931 Enumerated 1 network events making 1 cumulative events for socket 1172
. 2015-11-16 19:40:27.931 Handling network read event on socket 1172 with error 0
. 2015-11-16 19:40:27.931 Prompt (keyboard interactive, "SSH server authentication", "Using keyboard-interactive authentication.", "Password: ")
. 2015-11-16 19:40:27.931 Using stored password.
. 2015-11-16 19:40:27.974 Waiting for the server to continue with the initialization
. 2015-11-16 19:40:27.974 Looking for incoming data
. 2015-11-16 19:40:27.974 Looking for network events
. 2015-11-16 19:40:28.563 Detected network event
. 2015-11-16 19:40:28.563 Enumerating network events for socket 1172
. 2015-11-16 19:40:28.563 Enumerated 1 network events making 1 cumulative events for socket 1172
. 2015-11-16 19:40:28.563 Handling network read event on socket 1172 with error 0
. 2015-11-16 19:40:28.563 Prompt (keyboard interactive, "SSH server authentication", <no instructions>, <no prompt>)
. 2015-11-16 19:40:28.564 Ignoring empty SSH server authentication request
. 2015-11-16 19:40:28.564 Waiting for the server to continue with the initialization
. 2015-11-16 19:40:28.564 Looking for incoming data
. 2015-11-16 19:40:28.564 Looking for network events
. 2015-11-16 19:40:28.594 Detected network event
. 2015-11-16 19:40:28.594 Enumerating network events for socket 1172
. 2015-11-16 19:40:28.594 Enumerated 1 network events making 1 cumulative events for socket 1172
. 2015-11-16 19:40:28.594 Handling network read event on socket 1172 with error 0
. 2015-11-16 19:40:28.594 Access granted
. 2015-11-16 19:40:28.594 Opening session as main channel
. 2015-11-16 19:40:28.594 Waiting for the server to continue with the initialization
. 2015-11-16 19:40:28.594 Looking for incoming data
. 2015-11-16 19:40:28.594 Looking for network events
. 2015-11-16 19:40:28.715 Detected network event
. 2015-11-16 19:40:28.715 Enumerating network events for socket 1172
. 2015-11-16 19:40:28.715 Enumerated 1 network events making 1 cumulative events for socket 1172
. 2015-11-16 19:40:28.715 Handling network read event on socket 1172 with error 0
. 2015-11-16 19:40:28.716 Server initiated key re-exchange
. 2015-11-16 19:40:28.716 Using Diffie-Hellman with standard group "group14"
. 2015-11-16 19:40:28.716 Doing Diffie-Hellman key exchange with hash SHA-1
. 2015-11-16 19:40:28.803 Waiting for the server to continue with the initialization
. 2015-11-16 19:40:28.803 Looking for incoming data
. 2015-11-16 19:40:28.803 Looking for network events
. 2015-11-16 19:40:28.842 Detected network event
. 2015-11-16 19:40:28.842 Enumerating network events for socket 1172
. 2015-11-16 19:40:28.842 Enumerated 1 network events making 1 cumulative events for socket 1172
. 2015-11-16 19:40:28.842 Handling network read event on socket 1172 with error 0
. 2015-11-16 19:40:28.907 Initialised AES-256 SDCTR client->server encryption
. 2015-11-16 19:40:28.907 Initialised HMAC-SHA-256 client->server MAC algorithm
. 2015-11-16 19:40:28.907 Initialised AES-256 SDCTR server->client encryption
. 2015-11-16 19:40:28.907 Initialised HMAC-SHA-256 server->client MAC algorithm
. 2015-11-16 19:40:28.907 Opened main channel
. 2015-11-16 19:40:28.907 Waiting for the server to continue with the initialization
. 2015-11-16 19:40:28.907 Looking for incoming data
. 2015-11-16 19:40:28.907 Looking for network events
. 2015-11-16 19:40:28.979 Detected network event
. 2015-11-16 19:40:28.979 Enumerating network events for socket 1172
. 2015-11-16 19:40:28.979 Enumerated 1 network events making 1 cumulative events for socket 1172
. 2015-11-16 19:40:28.979 Handling network read event on socket 1172 with error 0
. 2015-11-16 19:40:28.979 Started a shell/command
. 2015-11-16 19:40:28.983 --------------------------------------------------------------------------
. 2015-11-16 19:40:28.983 Using SFTP protocol.
. 2015-11-16 19:40:28.984 Doing startup conversation with host.
. 2015-11-16 19:40:28.984 Session upkeep
. 2015-11-16 19:40:28.984 Looking for network events
. 2015-11-16 19:40:28.984 Timeout waiting for network events
> 2015-11-16 19:40:29.034 Type: SSH_FXP_INIT, Size: 5, Number: -1
> 2015-11-16 19:40:29.034 01,00,00,00,06,
. 2015-11-16 19:40:29.034 Sent 9 bytes
. 2015-11-16 19:40:29.034 There are 0 bytes remaining in the send buffer
. 2015-11-16 19:40:29.034 Looking for network events
. 2015-11-16 19:40:29.034 Timeout waiting for network events
. 2015-11-16 19:40:29.034 Waiting for another 4 bytes
. 2015-11-16 19:40:29.034 Looking for incoming data
. 2015-11-16 19:40:29.034 Looking for network events
. 2015-11-16 19:40:29.050 Detected network event
. 2015-11-16 19:40:29.050 Enumerating network events for socket 1172
. 2015-11-16 19:40:29.050 Enumerated 1 network events making 1 cumulative events for socket 1172
. 2015-11-16 19:40:29.050 Handling network read event on socket 1172 with error 0
. 2015-11-16 19:40:29.050 Received 154 bytes (0)
. 2015-11-16 19:40:29.050 Read 4 bytes (150 pending)
. 2015-11-16 19:40:29.050 Read 150 bytes (0 pending)
< 2015-11-16 19:40:29.050 Type: SSH_FXP_VERSION, Size: 150, Number: -1
< 2015-11-16 19:40:29.050 02,00,00,00,03,00,00,00,18,70,6F,73,69,78,2D,72,65,6E,61,6D,65,40,6F,70,65,
< 2015-11-16 19:40:29.050 6E,73,73,68,2E,63,6F,6D,00,00,00,01,31,00,00,00,13,73,74,61,74,76,66,73,40,
< 2015-11-16 19:40:29.050 6F,70,65,6E,73,73,68,2E,63,6F,6D,00,00,00,01,32,00,00,00,14,66,73,74,61,74,
< 2015-11-16 19:40:29.050 76,66,73,40,6F,70,65,6E,73,73,68,2E,63,6F,6D,00,00,00,01,32,00,00,00,14,68,
< 2015-11-16 19:40:29.050 61,72,64,6C,69,6E,6B,40,6F,70,65,6E,73,73,68,2E,63,6F,6D,00,00,00,01,31,00,
< 2015-11-16 19:40:29.050 00,00,11,66,73,79,6E,63,40,6F,70,65,6E,73,73,68,2E,63,6F,6D,00,00,00,01,31,
. 2015-11-16 19:40:29.050 SFTP version 3 negotiated.
. 2015-11-16 19:40:29.050 Unknown server extension posix-rename@openssh.com="1"
. 2015-11-16 19:40:29.050 Supports statvfs@openssh.com extension version "2"
. 2015-11-16 19:40:29.050 Unknown server extension fstatvfs@openssh.com="2"
. 2015-11-16 19:40:29.050 Supports hardlink@openssh.com extension version "1"
. 2015-11-16 19:40:29.050 Unknown server extension fsync@openssh.com="1"
. 2015-11-16 19:40:29.050 We believe the server has signed timestamps bug
. 2015-11-16 19:40:29.050 We will use UTF-8 strings until server sends an invalid UTF-8 string as with SFTP version 3 and older UTF-8 string are not mandatory
. 2015-11-16 19:40:29.050 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2015-11-16 19:40:29.050 Getting current directory name.
. 2015-11-16 19:40:29.050 Getting real path for '.'
> 2015-11-16 19:40:29.050 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
> 2015-11-16 19:40:29.050 10,00,00,00,10,00,00,00,01,2E,
. 2015-11-16 19:40:29.050 Sent 14 bytes
. 2015-11-16 19:40:29.050 There are 0 bytes remaining in the send buffer
. 2015-11-16 19:40:29.050 Looking for network events
. 2015-11-16 19:40:29.050 Timeout waiting for network events
. 2015-11-16 19:40:29.050 Waiting for another 4 bytes
. 2015-11-16 19:40:29.050 Looking for incoming data
. 2015-11-16 19:40:29.050 Looking for network events
. 2015-11-16 19:40:29.066 Detected network event
. 2015-11-16 19:40:29.066 Enumerating network events for socket 1172
. 2015-11-16 19:40:29.066 Enumerated 1 network events making 1 cumulative events for socket 1172
. 2015-11-16 19:40:29.066 Handling network read event on socket 1172 with error 0
. 2015-11-16 19:40:29.066 Received 33 bytes (0)
. 2015-11-16 19:40:29.066 Read 4 bytes (29 pending)
. 2015-11-16 19:40:29.066 Read 29 bytes (0 pending)
< 2015-11-16 19:40:29.066 Type: SSH_FXP_STATUS, Size: 29, Number: 16
< 2015-11-16 19:40:29.066 65,00,00,00,10,00,00,00,02,00,00,00,0C,4E,6F,20,73,75,63,68,20,66,69,6C,65,
< 2015-11-16 19:40:29.066 00,00,00,00,
< 2015-11-16 19:40:29.066 Status code: 2, Message: 16, Server: No such file, Language:  
* 2015-11-16 19:40:29.066 (ECommand) Error getting name of current remote directory.
* 2015-11-16 19:40:29.066 Cannot get real path for '.'.
* 2015-11-16 19:40:29.066 No such file or directory.
* 2015-11-16 19:40:29.066 Error code: 2
* 2015-11-16 19:40:29.066 Error message from server: No such file

1 个答案:

答案 0 :(得分:1)

您的帖子中有两个不同的问题。

  

无法解析返回的路径。

  

无法规范化:没有此类文件或目录

这些是由于服务器返回客户端请求解决.路径(主目录)的奇怪内容而导致的FileZilla和OpenSSH错误。

您无法让OpenSSH sftp在尝试启动时尝试解析.。无论您使用什么语法,它都会无条件地执行此操作。

您可以尝试连接WinSCP并将logging设置为Debug 2级吗?它将在日志中包含更多详细信息,以便我们知道它是什么打破了客户端。

  

追踪:做Diffie-Hellman小组交换
  **大约30秒过**

不确定为什么DH组上的FileZilla超时交换。

但是如您所知ECDH有效,请确保使用支持ECDH的FileZilla版本。您的版本(SSH-2.0-PuTTY_Local:_Sep_14_2013_01:12:43)没有。