1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to change the SSH port in CentOS 6

Discussion in 'Site & Server Administration' started by wlanguide, Dec 26, 2011.

  1. #1
    Hi guys, I recently upgraded from CentOS 5.5 to CentOS 6 and I have a little question, how to change the SSH port?

    I tried Google, all information I could find say edit ssh_config and sshd_config and change the port from 22 to any number you wish.

    However when I opened these two files, I saw:
    # port 22

    Well this means the line is commented and does not work, right?

    So where I can change the port? I could not risk messing it up guys as I have no physical access to the server and SSH, so anyone could give me any advice that really works?

    Thanks
     
    wlanguide, Dec 26, 2011 IP
  2. wisdomtool

    wisdomtool Moderator Staff

    Messages:
    15,825
    Likes Received:
    1,367
    Best Answers:
    1
    Trophy Points:
    455
    #2
    Uncomment it and change the port to some other ports, remember to update your firewall too.
     
    wisdomtool, Dec 26, 2011 IP
  3. filegrasper

    filegrasper Active Member

    Messages:
    493
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #3
    try this

    nano /etc/ssh/sshd_config

    and change this

    Port 22

    then you have to restart , it wi works

    /etc/init.d/ssh restart
     
    filegrasper, Dec 26, 2011 IP
  4. wlanguide

    wlanguide Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi guys, thanks for the replies, it worked!!!:)
     
    wlanguide, Dec 26, 2011 IP
  5. ProxyFreak

    ProxyFreak Peon

    Messages:
    57
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I love a fellow "nano" user. Working on server over the years, a lot of people are like what are you using for your text editor. Not very often to see someone that knows what it is. Listen to any nano user, they know what they are talking about:) We are generally old school server admins.
     
    ProxyFreak, Dec 26, 2011 IP
  6. ezbnc

    ezbnc Peon

    Messages:
    168
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Nano is the bomb I use to use pico which is kind of the same to me.
     
    ezbnc, Dec 26, 2011 IP