title: Executing remote commands with sshsession Ant task
body: <p>I'm having issues with <a href="http://ant.apache.org/manual/Tasks/sshsession.html" rel="nofollow" title="sshsession">sshsession</a> Ant task. </p>
  
  <p>I'm writing a deploy script which bzip sources, scp the archive to a remote server and then unzip sources on the remote server and copy files in the right directory tree.</p>
  
  <pre><code>(...)
  
  &lt;bzip2 src="/tmp/${selected.target}.tar" destfile="/tmp/${selected.target}.tar.bz2"/&gt;
  &lt;scp file="/tmp/${selected.target}.tar.bz2" todir="user@server:/tmp/" keyfile="${user.home}/.ssh/id_rsa" trust="yes" passphrase="thisisasecret"/&gt;
  
  &lt;sshsession host="server" username="user" keyfile="${user.home}/.ssh/id_rsa" trust="yes"&gt;
      &lt;sequential&gt;
          &lt;untar src="/tmp/${selected.target}.tar.bz2" dest="/tmp/prova_untar" compression="bzip2"/&gt;
          (copy files)
      &lt;/sequential&gt;
  &lt;/sshsession&gt;
  
  (...)
  </code></pre>
  
  <p>My problem is with tasks specified inside the sshsession, since they are executed locally and not on the remote server. I thought (but clearly i'm wrong) that command specified within sshsession tag would be executed on the server i just connected to. I read in the documentation that you can specify tunnels with localtunnel and remotetunnel, but i'm not sure i'm understanding correctly what those tunnels are for. Does anyone has encountered the same problem, or has a solution for that? The Ant version i'm working with is 1.8.2.
  Thanks,</p>
  
  <p>Alberto</p>