Change ssh to listen on two ports

Discussion in 'General' started by Toucan, Jul 15, 2010.

  1. Toucan

    Toucan Member

    Is it possible to set ssh listen on two ports?

    I want to have the standard port listening as usual as this is used by rsync etc, but also to have a secondary port listening for other connections. This is because I have two servers sitting behind a portforwarding router and I want to set a second port to forward to the backup server so I can ssh both remotely.

    At the moment I ssh the main one... and then ssh the internal ip from that shell!!...which is a bit cumbersome.
     
  2. damir

    damir New Member

    SSH can listen on multiple ports. Just add additional ports in sshd_config like this:

    Port 22
    Port 8888

    restart sshd daemon and you are good to go.
     
    Jesse Norell likes this.
  3. Toucan

    Toucan Member

    Solved

    Thanks, worked a treat.:D
     
  4. damir

    damir New Member

    ^ Awesome :)
     
  5. geraldpasion

    geraldpasion New Member

    hi, this is great, but what then shall be my command in terminal?
    does
    ssh username@hostname ​
    is enough?
    I need to access the server listening to 2 ports.
    I use
    ssh -L 80:localhost:80 username@hostname
    ssh -L 13013:localhost:13013 username@hostname
    on a separate terminal
    thanks!
     
  6. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    To access a server on a different ssl-port, use ssl -p PORT ....
     
  7. Ulrik

    Ulrik New Member

    will sshd: in /etc/hosts.allow work for both ports or can I setup different rules for the second port?
     

Share This Page