【问题标题】:Ssh tunneling with antssh隧道与蚂蚁
【发布时间】: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


    【解决方案1】:

    我解决了我的问题,所以如果有人遇到同样的问题,您唯一需要添加的是 sshexec 标记中的 trust 属性并将其设置为 true。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-13
      • 2011-07-02
      • 2015-03-22
      • 1970-01-01
      • 1970-01-01
      • 2020-06-21
      • 2020-07-31
      • 1970-01-01
      相关资源
      最近更新 更多