Welcome to Centmin Mod Community
Register Now

Changing ssh port not working on Centos 7

Discussion in 'Install & Upgrades or Pre-Install Questions' started by pamamolf, Feb 26, 2015.

  1. pamamolf

    pamamolf Well-Known Member

    2,721
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    3:34 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Hi

    I just try to change the ssh port on Centos 7 but was not working :(

    It was not auto added on tcp in on csf and on :

    Code:
    /etc/ssh/sshd_config
    was not enabled the line Port 1022
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    10:34 PM
    Nginx 1.13.x
    MariaDB 5.5
    did you follow instructions on the menu option 16, to first enter default sshd port then the port you want to change to ?
     
  3. pamamolf

    pamamolf Well-Known Member

    2,721
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    3:34 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Yes i add the default port 22 and then new port...easy to follow instructions....

    To make it work i just edit manual the:

    Code:
    /etc/ssh/sshd_config
    and remove the comment from:
    Code:
    Port 1022
    Then restart sshd and all was fine and i also add a custom iptables accept rule :)

    Like doing everything manually ......
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    10:34 PM
    Nginx 1.13.x
    MariaDB 5.5
  5. pamamolf

    pamamolf Well-Known Member

    2,721
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    3:34 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Don't know what to say :(