lara_croft
lara_croft

Reputation: 11

Ssh tunneling with ant

I need to connect to websphere server on remote host from my local computer. I have used ant for creating ssh session and local tunneling. When I execute this target below, connection to host :"somehost" is successfully but connection to targetHost is failing. Can someone please help me? I need to connect to "targetHost" througt "somehost".

The target I made for this connection is:

<target name="connect-to-websphere">
    <taskdef name="sshexec" classname="org.apache.tools.ant.taskdefs.optional.ssh.SSHExec">
        <classpath refid="build.classpath.jar"/>
    </taskdef>
    <taskdef name="sshsession" classname="org.apache.tools.ant.taskdefs.optional.ssh.SSHSession">
        <classpath refid="build.classpath.jar"/>
    </taskdef>
    <sshsession host="somehost"
                username="user"
                password="pass"
                port="22">
        <localtunnel lport="3000" rhost="targetHostWhereIsWebsphere" rport="22"/>
        <sequential>
            <sshexec host="localhost"
                     username="userFortargetHost"
                     password="passwordFortargetHost"
                     port="3000"
                     command="dummy command;">
            </sshexec>
        </sequential>
    </sshsession>
</target>

Upvotes: 0

Views: 543

Answers (1)

lara_croft
lara_croft

Reputation: 11

I resolve my problem, so if anyone would have the same problem the only thing you need to add is trust attribute in sshexec tag and set it on true.

Upvotes: 1

Related Questions