title: ANT SSHEXEC Password Prompt issues with su -c
body: <p>I have trying to get round and issue with ANT / SSHEXEC command.</p>
  
  <p>The setup:</p>
  
  <p>Solaris server using NIS and Role based user for runtime activities.</p>
  
  <p>You cannot login directly to the RBAC account, you have to connect as personal user and the su to the user - I have been advised that SUDO is not an option in this environment.</p>
  
  <p>So so scenario is I am building some ANT scripts to build, deploy and then run a set of scripts on a remote server.</p>
  
  <p>The build and deploy is fine as this is being carried out as my user, but when try to connect using SSHEXEC to su -c $user I have an issue, where the shell responds with a password prompt, but I cannot enter anything.</p>
  
  <p>So here I either want a solution that lets me type the password in and continue or a way to pass the password to the prompt as a variable I have entered.</p>
  
  <p>Here is the code I am currently using:</p>
  
  <pre><code>&lt;target name="install-products"&gt;
    &lt;sshexec host="${remote.host1}" 
      username="${remote.user}" 
      password="${remote.pwd}"
      command="/usr/bin/su - $user -c cd ${remote.install.dir}/OracleSunJDK;./installJAVA.sh -p project -e 935"
      usepty="true"
      trust="true"
      failonerror="true"/&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>So I am connecting in as my user, example ssh -t cambolie@${remote.host1}... which the user and password is passed as above, its the su -c that then causes the prompt to appear.</p>
  
  <p>This is what currently happens:</p>
  
  <pre><code>install-products:
  [sshexec] Connecting to ${remote.host1}:22
  [sshexec] cmd : /usr/bin/su - ${su-user}  -c cd /var/tmp/weblogic/RP_WEBLOGIC_J2EE_1.0.0.0/install/OracleSunJDK;./installJAVA.sh -p project -e 935
  [sshexec] Password:
  </code></pre>
  
  <p>It just hangs at this stage.</p>
  
  <p>Can anyone help?</p>