4
votes

I am having issues with an 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 hitting an issue.

I can get it to connect, but getting prompted for:

[sshexec] Connecting to $HOST:22

[sshexec] Kerberos username [$Local_USER]:

[sshexec] Kerberos password for $Local_USER:

Now if I just hit return at each prompt, it proceeds and executes the command.

I am using this method for automation, so defeats the purpose 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 tried with jsch-0.1.29)

Can anyone help or advise if I am doing something wrong?

Thanks in advance.

Paul

4
Is it possible for you to use an older version of ANT ? - Pulak Agrawal
No reason why not, any particular version you would recommend? - Cambolie
well.. honestly a wild guess.. SSHEXEC task has been updated in ANT 1.8.3 to include new attributes. So just looking to eliminate/narrow down the error whether its with the network OR remote site (as Aaron suggested) OR with ANT/sshexec.. so any version prior to 1.8.2 should do - Pulak Agrawal
Tried with version 1.7.1 exactly the same issue :( - Cambolie
now that you have found the answer. please put that in an answer from and and accept so this solution becomes useful for others. - Pulak Agrawal

4 Answers

2
votes

The issue here lies within Java 7.

In JAVA 7 they have introduced Kerberos into the java.security and in such this has caused the issue to prompt for kerberos user / password before proceeding.

I have fixed this issue by downgrading to Java 1.6.

I am still researching the fix for the 1.7 version of Java - may require further configuration of the kerberos conf file for java.

2
votes

You can downgrade to Java 1.6 as Cambolie suggested or you can just add -noinput to fix this problem.

For example:

ant -noinput [some_target]
2
votes

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

There was a bug report with Apache which shows it having been fixed as of Jan-2013.

0
votes

This is probably a misconfiguration on the remote side. It certainly shouldn't ask for the user name. Talk to your sysadmin about this. I'm also worried about Kerberos because that's completely unrelated to SSH.

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