" Auth失败" (com.jcraft.jsch.JSchException)

时间:2015-02-09 09:13:34

标签: java eclipse tomcat ant scp

我编写了一个ant脚本来复制本地tomcat服务器(在根目录中)的文件,如下所示:

<target name="temp">
     <scp todir="tomcat:tomcat@localhost:8080">
             <fileset dir="C:\Users\akhilesh.kj\Desktop\Plugin"/>
      </scp>    
</target>

我在我的机器上有openSSH。我不知道它是如何工作的。当我运行上面的脚本时,我得到了'auth fail&#39; exception.I已验证用户名和密码是否正确.Below是日志:

         [scp] Connecting to localhost:22
     [scp] Connecting to localhost port 22
     [scp] Connection established
     [scp] Remote version string: SSH-2.0-OpenSSH_3.8.1p1
     [scp] Local version string: SSH-2.0-JSCH-0.1.42
     [scp] CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
     [scp] SSH_MSG_KEXINIT sent
     [scp] SSH_MSG_KEXINIT received
     [scp] kex: server->client aes128-ctr hmac-md5 none
     [scp] kex: client->server aes128-ctr hmac-md5 none
     [scp] SSH_MSG_KEXDH_INIT sent
     [scp] expecting SSH_MSG_KEXDH_REPLY
     [scp] ssh_rsa_verify: signature true
     [scp] Permanently added 'localhost' (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: publickey,keyboard-interactive,password
     [scp] Next authentication method: publickey
     [scp] Authentications that can continue: keyboard-interactive,password
     [scp] Next authentication method: keyboard-interactive
     [scp] Authentications that can continue: password
     [scp] Next authentication method: password
     [scp] Disconnecting from localhost port 22
com.jcraft.jsch.JSchException: Auth fail 

请帮忙!

感谢。

1 个答案:

答案 0 :(得分:0)

尝试

copy代替scp

这可能有用......