Welcome to Centmin Mod Community
Become a Member

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

    4,003
    420
    83
    May 31, 2014
    Ratings:
    +812
    Local Time:
    2:35 PM
    Nginx-1.17.x
    MariaDB 10.3.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

    49,875
    11,487
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,839
    Local Time:
    9:35 PM
    Nginx 1.21.x
    MariaDB 10.x
    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

    4,003
    420
    83
    May 31, 2014
    Ratings:
    +812
    Local Time:
    2:35 PM
    Nginx-1.17.x
    MariaDB 10.3.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

    49,875
    11,487
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,839
    Local Time:
    9:35 PM
    Nginx 1.21.x
    MariaDB 10.x
  5. pamamolf

    pamamolf Well-Known Member

    4,003
    420
    83
    May 31, 2014
    Ratings:
    +812
    Local Time:
    2:35 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    Don't know what to say :(