Mengganti port SSH CentOS 7


 


Langkah pertama ya edit konfigurasi daemon SSH:

nano /etc/ssh/sshd_config

Didalamnya gantikan portnya:

Port 12345

Nah sebenarnya disini ada satu tahap lagi, karena setahu saya CentOS 7 itu SELinux pasti aktif dan aturan defaultnya SSH itu hanya bisa lewat port 22. Jadi kita perlu tambahkan whitelistnya:

semanage port -a -t ssh_port_t -p tcp 12345

Akhirnya kita perlu instruksikan firewallnya agar port baru diatas diijinkan:

firewall-cmd --permanent --zone=public --add-port=12345/tcp

Setelahnya kita reload setting barunya:

firewall-cmd --reload

Baru kita restart proses SSH:

systemctl restart sshd.service


thats all. 

Sumber : https://servernesia.com/2713/mengganti-port-ssh-centos-7/



Mengganti port SSH CentOS 7 Mengganti port SSH CentOS 7 Reviewed by ilham.sp on March 01, 2021 Rating: 5

No comments:

Notice

This site uses cookies from Google to deliver its services, to personalise ads and to analyse traffic. Information about your use of this site is shared with Google. By using this site, you agree to its use of cookies.Learn More

Powered by Blogger.