CentOS 22 default port SSH default port

Source: Internet
Author: User

1. Add a port

Vim/etc/ssh/sshd_config

Remove the comment of # Port 22 and add the line feed to Port 443.

If you want to add but modify the port number, we recommend that you keep port 22 and wait until the new port can be logged on and removed.

443 is actually the port used by https, and 3128 is the port used by squid. We recommend that you use a large port, such as 10000 ~ More than 65535.

Restart the SSH service/etc/init. d/sshd restart

2. Enable Firewall port 443

Vi/etc/sysconfig/iptables

Add-a input-m state-state NEW-m tcp-p tcp-dport 443-j ACCEPT

Restart Firewall/etc/init. d/iptables restart

3. shield the default port

It is recommended that the default port 22 be blocked after the new port can be used.

Vi/etc/sysconfig/iptables

In

-A RH-Firewall-1-INPUT-m state-state NEW-m tcp-p tcp-dport 22-j ACCEPT

Comment out the prefix #

Restart Firewall/etc/init. d/iptables restart

Successful!

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.