ssh tunnel to non-standard ssh port

Discussion in 'Linux Networking' started by gmac63, Aug 20, 2007.

  1. gmac63

    gmac63 Guest

    I have an instance where I am wanting to connect to a remote server
    which has ssh listening on a non-standard port (22170). I cannot
    create a ssh tunnel without ssh also listening to port 22 or have no
    port assigned -- I also have to open port 22 on my firewall.

    Is there a way that I can create a ssh tunnel to a remote server which
    has ssh listening on a non-standard port? Here is my tunnel command:

    ssh -f -N -R 22170:localhost:22 [email protected]

    TIA
    gmac63
     
    gmac63, Aug 20, 2007
    #1
    1. Advertisements

  2. gmac63

    Burkhard Ott Guest

    Am Mon, 20 Aug 2007 04:03:38 -0700 schrieb gmac63:
    -p $RemotePort
     
    Burkhard Ott, Aug 20, 2007
    #2
    1. Advertisements

  3. gmac63

    gmac63 Guest

    well son of a ...., that worked!!! Thanks Burhard!

    gmac63
     
    gmac63, Aug 20, 2007
    #3
  4. gmac63

    Guest Guest

    On Mon, 20 Aug 2007 15:45:31 -0000 wrote:

    | well son of a ...., that worked!!! Thanks Burhard!
    |
    | gmac63
    |
    |> Am Mon, 20 Aug 2007 04:03:38 -0700 schriebgmac63:
    |>
    |> > I have an instance where I am wanting to connect to a remote server
    |> > which has ssh listening on a non-standard port (22170). I cannot
    |> > create a ssh tunnel without ssh also listening to port 22 or have no
    |> > port assigned -- I also have to open port 22 on my firewall.
    |>
    |> > Is there a way that I can create a ssh tunnel to a remote server which
    |> > has ssh listening on a non-standard port? Here is my tunnel command:
    |>
    |> > ssh -f -N -R 22170:localhost:22 [email protected]
    |>
    |> > TIA
    |> >gmac63
    |>
    |> -p $RemotePort

    Also this can be done in the config file to always for a particular port
    for a particular host.
     
    Guest, Aug 22, 2007
    #4
  5. yes... there are examples in the /etc/ssh/ssh_config file.... something
    like:

    host hostname
    port port-number

    jack

    --
    D.A.M. - Mothers Against Dyslexia

    see http://www.jacksnodgrass.com for my contact info.

    jack - Grapevine/Richardson
     
    Jack Snodgrass, Aug 22, 2007
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.