CentOS system to modify the SSH telnet port

Source: Internet
Author: User
Tags ssh centos iptables ssh server

1. Modify SSH telnet port to 8888
# Vi/etc/ssh/sshd_config

Port 8888 #把 #Port 22 modified to port 8888


# servicesshd Restart #重启SSH服务 or service sshd restart

2. Firewall Add port
The default iptables only part of the port, use additional ports such as 8888 need to add white list in iptables otherwise you will not be able to connect to the SSH server
# iptables-i input-p TCP--dport 8888-j ACCEPT
# iptables-a input-p TCP--dport 8888-j ACCEPT
#service iptables Save
The first command takes effect immediately but is invalidated after reboot, so you need to save the command to the iptables configuration file, path:/etc/sysconfig/iptables,
Saved commands can also be: Iptables-save >/etc/sysconfig/iptables

Some knowledge of iptables:
Centos 6.x iptables open port white list
Linux iptables Shielding or IP
Iptables usage

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.