【发布时间】:2017-09-08 03:10:18
【问题描述】:
我需要从本地计算机连接到远程主机上的 websphere 服务器。 我使用 ant 创建 ssh 会话和本地隧道。当我在下面执行此目标时,与主机的连接:“somehost”成功,但与 targetHost 的连接失败。有人可以帮帮我吗?我需要通过“somehost”连接到“targetHost”。
我为这个连接设定的目标是:
<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>
【问题讨论】:
标签: ssh ant ssh-tunnel