Results 1 to 3 of 3

Thread: (Ubuntu Server) Changing SSH Port 22 to Port 2222

  1. #1
    Join Date
    Sep 2010
    Beans
    55

    (Ubuntu Server) Changing SSH Port 22 to Port 2222

    I'm trying to change the open port for SSH on my Ubuntu Server. I have two Ubuntu Servers on the same network, and am trying to be able to access both of them from outside the local network. The process is very simple on the server guide page. I just need to change Port 22 (actually commented out by default) to Port 2222 (and of course uncomment it). Then restart the SSH server.

    All this is very simple and straight forward. But, after doing this, and not being able to connect, I found out by running
    Code:
    netstat -an | grep "LISTEN "
    that I am actually not listening to port 2222, but still listening to port 22.

    Anyone know what I can do to resolve this issue?

    Thank you in advance.

  2. #2
    Join Date
    Mar 2006
    Location
    /dev/null
    Beans
    2,684

    Re: (Ubuntu Server) Changing SSH Port 22 to Port 2222

    modify /etc/ssh/sshd_config

    where it says:


    # What ports, IPs and protocols we listen for
    Port 22 <---change port to what you need it to be

    then save and restart ssh server

    and adjust your router to forward request to correct port and internal IP
    First they ignore you.Then they laugh at you. Then they fight you.Then you win.Gandhi
    Linux para las masas
    Resistance Is Futile. You Will Be Assimilated!

  3. #3
    Join Date
    Sep 2010
    Beans
    55

    Re: (Ubuntu Server) Changing SSH Port 22 to Port 2222

    I was accidentally editing the /etc/ssh/ssh_config file instead of the /etc/ssh/sshd_config file. I think I just misread the guide I was following. Thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •