我想使用 scp 将文件复制到远程服务器。我正在使用与 Eclipse Indigo 捆绑在一起的 Ant 1.8.2。此外,我尝试了各种 jsch-*.jar 文件(从 0.1.29 到 0.1.46)。在 0.1.30 之前,我收到一个错误,抱怨缺少 Logger。从 0.1.30 及更高版本开始,它没有显示任何错误,但在消息“身份验证成功(密码)。”之后挂起。
这就是定义:
<scp verbose="true"
remoteTodir="user@myserver.local:/mydir/"
trust="true"
password="mypwd"
>
<fileset dir="${dist}">
<include name="myfile/>
</fileset>
</scp>
这是任务的输出:
Buildfile: C:\workspace\build.xml uploadtostaging:
[echo] Uploading to staging server via FTP ...
[scp] Connecting to com.myserver.local:22
[scp] Connecting to com.myserver.local port 22
[scp] Connection established
[scp] Remote version string: SSH-2.0-xlightftpd_release_3.7.1
[scp] Local version string: SSH-2.0-JSCH-0.1.30
[scp] SSH_MSG_KEXINIT received
[scp] SSH_MSG_KEXINIT sent
[scp] kex: server->client 3des-cbc hmac-sha1 none
[scp] kex: client->server 3des-cbc hmac-sha1 none
[scp] SSH_MSG_KEXDH_INIT sent
[scp] expecting SSH_MSG_KEXDH_REPLY
[scp] ssh_rsa_verify: signature true
[scp] Permanently added 'com.myserver.local' (RSA) to the list of known hosts.
[scp] SSH_MSG_NEWKEYS sent
[scp] SSH_MSG_NEWKEYS received
[scp] SSH_MSG_SERVICE_REQUEST sent
[scp] SSH_MSG_SERVICE_ACCEPT received
[scp] Authentications that can continue: password
[scp] Next authentication method: password
[scp] Authentication succeeded (password).
(...) hangs virtually forever (> 10mins)