1

我正在使用curlRed Hat 5.7 服务器从各个公司下载文件。

但是一个连接给了我以下错误(匿名):

curl -v -u 'anonymous:' sftp://sftp.acme.com/
* About to connect() to sftp.acme.com port 22 (#0)
*   Trying x.x.x.x...
* connected
* Connected to sftp.acme.com (x.x.x.x) port 22 (#0)
* SSH MD5 fingerprint: 95febe8759c980cd9526ec2b90....
* SSH host check: 0, key: AAAAB3NzaC1yc2EAAAADAQA....
* SSH authentication methods available: publickey,password,keyboard-interactive
* Using ssh public key file /home/lanes/.ssh/id_rsa.pub
* Using ssh private key file /home/lanes/.ssh/id_rsa
* Initialized SSH public key authentication
* Authentication complete
* Failure initializing sftp session: Unable to send SSH_FXP_INIT
* Closing connection #0
curl: (2) Failure initializing sftp session: Unable to send SSH_FXP_INIT

sftp工作正常:

sftp anonymous@sftp.acme.com
Connecting to sftp.acme.com...
ACME File Transfer Prod #1
sftp> quit

有没有人见过这个SSH_FXP_INIT错误?


curl --version
curl 7.24.0 (x86_64-redhat-linux-gnu) libcurl/7.24.0 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 libssh2/1.2.2
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz

详细sftp输出:

sftp -v anonymous@sftp.acme.com
Connecting to sftp.acme.com...
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to sftp.acme.com [139.149.22.130] port 22.
debug1: Connection established.
debug1: identity file /home/lanes/.ssh/id_rsa type 1
debug1: identity file /home/lanes/.ssh/id_dsa type -1
debug1: loaded 2 keys
debug1: Remote protocol version 2.0, remote software version SSHD
debug1: no match: SSHD
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Host 'sftp.acme.com' is known and matches the RSA host key.
debug1: Found key in /home/lanes/.ssh/known_hosts:23
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
UBS File Transfer Prod #2
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /home/lanes/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending subsystem: sftp
4

1 回答 1

0

你能用psftp连接到服务器吗?如果是这样,看看 PuTTY 日志说什么会很有趣。

于 2013-06-09T21:58:23.397 回答