2018年8月27日 星期一

SSH 修改port

1. vim /etc/ssh/sshd_config
====
Port 2222
====

2. systemctl restart sshd.service

3. By default, SELinux only allows SSH on the port 22. We must change this to our new port. In our example, we are using 2222 but you should replace this number with the number of your port in the below command, which uses semanage port to configure ports in the SELinux policy:
semanage port -a -t ssh_port_t -p tcp 2222

4. firewall-cmd --permanent --zone=public --add-port=2222/tcp
5. firewall-cmd --reload


#https://www.globo.tech/learning-center/change-ssh-port-centos-7/

沒有留言:

張貼留言

Centos GUI Webserver 設定

新灌的一台Centos7可以做以下的設定 語系設定: - sudo localectl set-locale LC_CTYPE=zh_TW.UTF-8 修改ssh port - http://linux.vbird.org/linux_server/0310telne...