Join the community today
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

    4,022
    421
    83
    May 31, 2014
    Ratings:
    +816
    Local Time:
    7:21 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

    50,476
    11,663
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,088
    Local Time:
    2:21 AM
    Nginx 1.25.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,022
    421
    83
    May 31, 2014
    Ratings:
    +816
    Local Time:
    7:21 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

    50,476
    11,663
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,088
    Local Time:
    2:21 AM
    Nginx 1.25.x
    MariaDB 10.x
  5. pamamolf

    pamamolf Well-Known Member

    4,022
    421
    83
    May 31, 2014
    Ratings:
    +816
    Local Time:
    7:21 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    Don't know what to say :(