ANT SSHEXEC Password Prompt issues with su -c ANT SSHEXEC Password Prompt issues with su -c shell shell

ANT SSHEXEC Password Prompt issues with su -c


The following is one of the possible solutions.

  1. Setup key-based scp from your host machine to your target machine.
  2. Modify your build script to scp a marker file (i.e. begin.install , zero byte file)
  3. Setup a cron on the target machine to look for the marker file, and once found, start the set of steps to be performed on that server. Once done, delete the marker file.


This worked for me:

   <property name="password" value="MYPASS"/>    <!-- Keep the closing property tag on the new line as su needs the CR/LF-->    <property name="password.crlf">${password}<!-- do not remove the CR/LF-->    </property>    <!-- Keep the closing property tag on the new line as su needs the CR/LF-->  <sshexec host="${server}"                 username="${username1}"                 password="${password1}"                 trust="yes"                 verbose="yes"                 usepty="true"                 inputproperty="password.crlf"                 command="su - otheruser -c ls"        />