can forward remote ports with putty but not with openssh command line client - SSH

This is a discussion on can forward remote ports with putty but not with openssh command line client - SSH ; Hi, I'm a bit baffled by the following problem. If I attempt to forward to remote ports via putty, it works just fine. If I attempt to do the same via command line openssh, I get a failure. I'm not ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: can forward remote ports with putty but not with openssh command line client

  1. can forward remote ports with putty but not with openssh command line client

    Hi,

    I'm a bit baffled by the following problem. If I attempt to forward to
    remote ports via putty, it works just fine. If I attempt to do the
    same via command line openssh, I get a failure. I'm not sure what
    putty is doing that I'm not! I'd like to be able to establish this
    tunnel from a mac so I need to use the command line ssh.

    [I've search-and-replaced specifics with generics like my-ssh-host, my-
    remote-server and my-username, but of course in the real test I used
    the actual values!]

    The following is what I'm trying via command line:

    $ ssh -f -g -N -R7000:my-remote-server:7000 -R 7001:my-remote-server:
    7001 my-username@my-ssh-host
    my-username@my-ssh-host's password:
    Warning: remote port forwarding failed for listen port 7000
    Warning: remote port forwarding failed for listen port 7001

    as you can see, the forwarding fails.

    And yes, I'm closing the putty-established tunnels before attempting
    to forward the same ports via command line ssh!

    When I try it via putty, it works. Below is an export of the registry
    key from my putty profile. Can anyone tell me what I'm doing wrong or
    what the equivalent command line options to create the connection that
    putty is creating?

    Thanks!

    putty settings from registry:

    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessi ons\my-port-
    forwarding-profile]
    "Present"=dword:00000001
    "HostName"="my-ssh-host"
    "LogFileName"="putty.log"
    "LogType"=dword:00000000
    "LogFileClash"=dword:ffffffff
    "LogFlush"=dword:00000001
    "SSHLogOmitPasswords"=dword:00000001
    "SSHLogOmitData"=dword:00000000
    "Protocol"="ssh"
    "PortNumber"=dword:00000016
    "CloseOnExit"=dword:00000001
    "WarnOnClose"=dword:00000001
    "PingInterval"=dword:00000000
    "PingIntervalSecs"=dword:00000000
    "TCPNoDelay"=dword:00000001
    "TCPKeepalives"=dword:00000000
    "TerminalType"="xterm"
    "TerminalSpeed"="38400,38400"
    "AddressFamily"=dword:00000000
    "ProxyExcludeList"=""
    "ProxyDNS"=dword:00000001
    "ProxyLocalhost"=dword:00000000
    "ProxyMethod"=dword:00000000
    "ProxyHost"="proxy"
    "ProxyPort"=dword:00000050
    "ProxyUsername"=""
    "ProxyPassword"=""
    "ProxyTelnetCommand"="connect %host %port\\n"
    "Environment"=""
    "UserName"=""
    "LocalUserName"=""
    "NoPTY"=dword:00000000
    "Compression"=dword:00000000
    "AgentFwd"=dword:00000000
    "ChangeUsername"=dword:00000000
    "Cipher"="aes,blowfish,3des,WARN,des"
    "KEX"="dh-gex-sha1,dh-group14-sha1,dh-group1-sha1,WARN"
    "RekeyTime"=dword:0000003c
    "RekeyBytes"="1G"
    "AuthTIS"=dword:00000000
    "AuthKI"=dword:00000001
    "SshNoShell"=dword:00000000
    "SshProt"=dword:00000002
    "SSH2DES"=dword:00000000
    "PublicKeyFile"=""
    "RemoteCommand"=""
    "RFCEnviron"=dword:00000000
    "PassiveTelnet"=dword:00000000
    "BackspaceIsDelete"=dword:00000001
    "RXVTHomeEnd"=dword:00000000
    "LinuxFunctionKeys"=dword:00000000
    "NoApplicationKeys"=dword:00000000
    "NoApplicationCursors"=dword:00000000
    "NoMouseReporting"=dword:00000000
    "NoRemoteResize"=dword:00000000
    "NoAltScreen"=dword:00000000
    "NoRemoteWinTitle"=dword:00000000
    "NoRemoteQTitle"=dword:00000001
    "NoDBackspace"=dword:00000000
    "NoRemoteCharset"=dword:00000000
    "ApplicationCursorKeys"=dword:00000000
    "ApplicationKeypad"=dword:00000000
    "NetHackKeypad"=dword:00000000
    "AltF4"=dword:00000001
    "AltSpace"=dword:00000000
    "AltOnly"=dword:00000000
    "ComposeKey"=dword:00000000
    "CtrlAltKeys"=dword:00000001
    "TelnetKey"=dword:00000000
    "TelnetRet"=dword:00000001
    "LocalEcho"=dword:00000002
    "LocalEdit"=dword:00000002
    "Answerback"="PuTTY"
    "AlwaysOnTop"=dword:00000000
    "FullScreenOnAltEnter"=dword:00000000
    "HideMousePtr"=dword:00000000
    "SunkenEdge"=dword:00000000
    "WindowBorder"=dword:00000001
    "CurType"=dword:00000000
    "BlinkCur"=dword:00000000
    "Beep"=dword:00000001
    "BeepInd"=dword:00000000
    "BellWaveFile"=""
    "BellOverload"=dword:00000001
    "BellOverloadN"=dword:00000005
    "BellOverloadT"=dword:000007d0
    "BellOverloadS"=dword:00001388
    "ScrollbackLines"=dword:000000c8
    "DECOriginMode"=dword:00000000
    "AutoWrapMode"=dword:00000001
    "LFImpliesCR"=dword:00000000
    "DisableArabicShaping"=dword:00000000
    "DisableBidi"=dword:00000000
    "WinNameAlways"=dword:00000001
    "WinTitle"=""
    "TermWidth"=dword:00000050
    "TermHeight"=dword:00000018
    "Font"="Courier New"
    "FontIsBold"=dword:00000000
    "FontCharSet"=dword:00000000
    "FontHeight"=dword:0000000a
    "FontVTMode"=dword:00000004
    "UseSystemColours"=dword:00000000
    "TryPalette"=dword:00000000
    "ANSIColour"=dword:00000001
    "Xterm256Colour"=dword:00000001
    "BoldAsColour"=dword:00000001
    "Colour0"="187,187,187"
    "Colour1"="255,255,255"
    "Colour2"="0,0,0"
    "Colour3"="85,85,85"
    "Colour4"="0,0,0"
    "Colour5"="0,255,0"
    "Colour6"="0,0,0"
    "Colour7"="85,85,85"
    "Colour8"="187,0,0"
    "Colour9"="255,85,85"
    "Colour10"="0,187,0"
    "Colour11"="85,255,85"
    "Colour12"="187,187,0"
    "Colour13"="255,255,85"
    "Colour14"="0,0,187"
    "Colour15"="85,85,255"
    "Colour16"="187,0,187"
    "Colour17"="255,85,255"
    "Colour18"="0,187,187"
    "Colour19"="85,255,255"
    "Colour20"="187,187,187"
    "Colour21"="255,255,255"
    "RawCNP"=dword:00000000
    "PasteRTF"=dword:00000000
    "MouseIsXterm"=dword:00000000
    "RectSelect"=dword:00000000
    "MouseOverride"=dword:00000001
    "Wordness0"="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0"
    "Wordness32"="0,1,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2, 2,1,1,1,1,1,1"
    "Wordness64"="1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,1,1,1,1,2"
    "Wordness96"="1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,1,1,1,1,1"
    "Wordness128"="1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1"
    "Wordness160"="1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1"
    "Wordness192"="2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2, 2,2,2,2,2,2,2"
    "Wordness224"="2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2, 2,2,2,2,2,2,2"
    "LineCodePage"=""
    "CJKAmbigWide"=dword:00000000
    "UTF8Override"=dword:00000001
    "Printer"=""
    "CapsLockCyr"=dword:00000000
    "ScrollBar"=dword:00000001
    "ScrollBarFullScreen"=dword:00000000
    "ScrollOnKey"=dword:00000000
    "ScrollOnDisp"=dword:00000001
    "EraseToScrollback"=dword:00000001
    "LockSize"=dword:00000000
    "BCE"=dword:00000001
    "BlinkText"=dword:00000000
    "X11Forward"=dword:00000001
    "X11Display"=""
    "X11AuthType"=dword:00000001
    "LocalPortAcceptAll"=dword:00000001
    "RemotePortAcceptAll"=dword:00000001
    "PortForwardings"="R7000=my-remote-server:7000,R7001=my-remote-server:
    7001,"
    "BugIgnore1"=dword:00000000
    "BugPlainPW1"=dword:00000000
    "BugRSA1"=dword:00000000
    "BugHMAC2"=dword:00000000
    "BugDeriveKey2"=dword:00000000
    "BugRSAPad2"=dword:00000000
    "BugPKSessID2"=dword:00000000
    "StampUtmp"=dword:00000001
    "LoginShell"=dword:00000001
    "ScrollbarOnLeft"=dword:00000000
    "BoldFont"=""
    "BoldFontIsBold"=dword:0040bd58
    "BoldFontCharSet"=dword:00468334
    "BoldFontHeight"=dword:0012ffb0
    "WideFont"=""
    "WideFontIsBold"=dword:76f24361
    "WideFontCharSet"=dword:0040bd58
    "WideFontHeight"=dword:0012ea24
    "WideBoldFont"=""
    "WideBoldFontIsBold"=dword:00000000
    "WideBoldFontCharSet"=dword:76f24361
    "WideBoldFontHeight"=dword:0000000a
    "ShadowBold"=dword:00000000
    "ShadowBoldOffset"=dword:00000001


  2. Re: can forward remote ports with putty but not with openssh command line client

    oops, ignore that space between the -R and the 7001 -- that wasn't
    there in the original command I tried!


  3. Re: can forward remote ports with putty but not with openssh commandline client

    mlevin schrieb:
    > oops, ignore that space between the -R and the 7001 -- that wasn't
    > there in the original command I tried!
    >


    and have you tried
    $ ssh -f -g -N -R 7000:my-remote-server:7000 -R
    7001:my-remote-server:7001 my-username@my-ssh-host

    instead? (one line command)

    wolfgang

  4. Re: can forward remote ports with putty but not with openssh command line client

    On Aug 9, 2:21 am, Wolfgang Meiners wrote:
    > mlevin schrieb:
    >
    > > oops, ignore that space between the -R and the 7001 -- that wasn't
    > > there in the original command I tried!

    >
    > and have you tried
    > $ ssh -f -g -N -R 7000:my-remote-server:7000 -R
    > 7001:my-remote-server:7001 my-username@my-ssh-host
    >
    > instead? (one line command)
    >
    > wolfgang


    Yep. That's what I had done originally. I guess it wrapped onto
    multiple lines in my post, but the original attempt was definitely all
    on one line. I just can't figure out what equivalent options putty is
    sending that makes it work!

    me@my-workstation ~
    $ ssh -f -g -N -R 7000:remote-host:7000 -R 7001:remote-host:7001
    me@ssh-host
    me@ssh-host's password:
    Warning: remote port forwarding failed for listen port 7000
    Warning: remote port forwarding failed for listen port 7001

    me@my-workstation ~
    $


+ Reply to Thread