【发布时间】:2015-07-01 05:51:29
【问题描述】:
我的 ant build.xml 通过 ssh 与另一台计算机连接时遇到问题。我有一台 IP 地址为:10.62.11.40 的计算机,我有一个 ant 代码可以连接这台计算机:
<available property="ant-jsch.present" file="${ant.home}/lib/ant-jsch.jar"/>
<fail if="ant-jsch.present" message="Please remove ant-jsch.jar from ANT_HOME/lib see [http://ant.apache.org/faq.html#delegating-classloader]"/>
<path id="jsch.path">
<pathelement location="lib/ant-jsch.jar" />
<pathelement location="lib/jsch-0.1.44.jar" />
</path>
<taskdef name="scp" classname="org.apache.tools.ant.taskdefs.optional.ssh.Scp" classpathref="jsch.path" />
<taskdef name="sshexec" classname="org.apache.tools.ant.taskdefs.optional.ssh.SSHExec" classpathref="jsch.path" />
<echo message="Start Working...123"/>
<sshexec host="10.62.11.40" username="${username}" password="${password}" command='cmd /C mkdir "C:\\\\newFolder"' trust="true" failonerror="true" verbose="true"/>
它是“ant build.xml”命令的一段输出:
[sshexec] ssh_rsa_verify: signature true
[sshexec] Permanently added '10.62.11.40' (RSA) to the list of known hosts.
[sshexec] SSH_MSG_NEWKEYS sent
[sshexec] SSH_MSG_NEWKEYS received
[sshexec] SSH_MSG_SERVICE_REQUEST sent
[sshexec] SSH_MSG_SERVICE_ACCEPT received
[sshexec] Authentications that can continue: publickey,keyboard-interactive,pa
ssword
[sshexec] Next authentication method: publickey
[sshexec] Authentications that can continue: keyboard-interactive,password
[sshexec] Next authentication method: keyboard-interactive
[sshexec] Authentications that can continue: password
[sshexec] Next authentication method: password
[sshexec] Authentication succeeded (password).
[sshexec] cmd : cmd /C mkdir "C:\\\\newFolder"
[sshexec] Caught an exception, leaving main loop due to SSH_MSG_DISCONNECT: 2
fork failed: Resource temporarily unavailable
[sshexec] Disconnecting from 10.62.11.40 port 22
BUILD FAILED
C:\isNowe\build.xml:11: The following error occurred while executing this line:
C:\isNowe\lib\macros\lib\is2k8.xml:36: Remote command failed with exit status -1
通过普通终端与这台计算机连接正常,我可以在这台计算机上连接并做一些事情。
'is2k8.xml:36'
这一行是
<sshexec host="10.62.11.40" username="${username}" password="${password}" command='cmd /C mkdir "C:\\\\newFolder"' trust="true" failonerror="true" verbose="true"/>
你有什么问题吗?
【问题讨论】:
-
你的服务器是什么? cygwin-ssh?