2015-04-23 157 views
0

我通过ssh与其他计算机通过我的ant build.xml进行连接时出现问题。我对计算机与IP地址:10.62.11.40,蚂蚁我有一个蚂蚁代码与该计算机连接:Ant ssh无法连接到计算机

<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"/> 

而且它是由“蚂蚁的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"/> 

你能有什么想法,什么`错了吗?

+0

什么是您的服务器? cygwin的-SSH? – Jayan

回答

0

你连接到远程主机成功,但远程命令失败:

cmd /C mkdir "C:\\\\newFolder"' 

你可以在命令行中成功运行此命令?

添加-d标志以从Ant获得调试输出也可能有所帮助。

相关问题