2017-04-12 3 views
0

私のローカルコンピュータからリモートホスト上のwebsphereサーバーに接続する必要があります。 私はsshセッションとローカルトンネリングを作成するためにantを使用しました。このターゲットを以下のように実行すると、ホスト「somehost」への接続は成功しましたが、targetHostへの接続は失敗しています。誰か助けてくれますか?私は "targetHost" througt "somehost"に接続する必要があります。antとのSshトンネリング

私はこの接続のために作られたターゲットがある:私は私の問題を解決する

<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> 

答えて

1

ので、誰もが同じ問題を抱えているならば、あなたが追加する必要がある唯一の事はsshexecタグの信頼の属性であり、それを設定します本当。

関連する問題