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 Premium Member Premium Member

    3,353
    318
    83
    May 31, 2014
    Ratings:
    +593
    Local Time:
    5:30 AM
    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

    40,634
    9,023
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,891
    Local Time:
    12:30 PM
    Nginx 1.15.x
    MariaDB 5.5/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 Premium Member Premium Member

    3,353
    318
    83
    May 31, 2014
    Ratings:
    +593
    Local Time:
    5:30 AM
    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 ......
     
    style="display:inline-block;min-width:400px;max-width:970px;width:95%;height:90px" data-ad-client="ca-pub-6669518204467592" data-ad-slot="4024536743" data-ad-format="auto">
  4. eva2000

    eva2000 Administrator Staff Member

    40,634
    9,023
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,891
    Local Time:
    12:30 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  5. pamamolf

    pamamolf Premium Member Premium Member

    3,353
    318
    83
    May 31, 2014
    Ratings:
    +593
    Local Time:
    5:30 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    Don't know what to say :(