ANT Task SSHEXEC Key File Issues

I'm having problems with the SSHEXEC ant task.

I am trying to connect to a remote host and execute a command.

I am trying to use "keyfile", so I do not need to use user / pass and remove the problem.

I can connect it, but I will be asked:

[sshexec] Connection to $ HOST: 22

[sshexec] Kerberos username [$ Local_USER]:

[sshexec] Kerberos password for $ Local_USER:

Now, if I just press return at each prompt, it continues and executes the command.

I use this method for automation, so the goal wins if you need to interact.

Here is the ant syntax:

<target name="explode" depends="deploy" description="Creating build on Deployment Server"> <sshexec host="${host}" username="${user}" keyfile="c:\paul\testkey" trust="true" command="${bin}/createBuild.sh"/> </target> 

Ant version - 1.8.3 Jsch version - jsch-0.1.42 (also used with jsch-0.1.29)

Can someone help or advise if I do something wrong?

Thanks in advance.

Floor

+4
source share
4 answers

The problem here is in Java 7.

In JAVA 7, they implemented Kerberos in java.security, and so this caused a problem with asking for the user / password of the kerberos user before continuing.

I fixed this problem by switching to Java 1.6.

I am still studying the fix for version 1.7 of the Java version - it may require further configuration of the kerberos config file for java.

+2
source

You can upgrade to Java 1.6, as Cambolie suggested, or you can simply add -noinput to fix this problem.

For instance:

 ant -noinput [some_target] 
+2
source

This issue is now addressed in the latest versions of Ant (1.9.1) and Jsch (0.1.50).

Apache had a bug report that shows that it has been fixed since January 2013.

+1
source

This is probably the wrong configuration on the remote side. Of course, you should not ask for a username. Talk with your administrator about this. Kerberos also bothers me because it is completely unrelated to SSH.

Also make sure that the public key is installed in the user account.

0
source

All Articles