Tips for modifying SSH remote connection ports for Linux

Source: Internet
Author: User
Tags ssh port

Modify the port of the SSH Terminal Service from 22 to another port to prevent attackers from directly guessing your server password

First modify the configuration file

Vi/etc/ssh/sshd_config

Find #Port 221 segment, here is the identity by default using 22 port, modified as follows:

Port 22
Port 5555

And then save the exit

Execution /etc/init.d/sshd Restart

this way the SSH port will work concurrently with the A and the 5555 on.

now edit the firewall configuration: Vi/etc/sysconfig/iptables

Enable the 5555 port.

Execute /etc/init.d/iptables Restart

Now, use the SSH tool to connect to the 5555 port to test for success.

If the connection is successful, edit the sshd_config settings again and delete the Port inside.

The reason is set to two ports, test success and then shut down a port, is to facilitate in the process of modifying the Conf, in case of falling off, network, Misoperation, and other unknown circumstances, but also through another port to connect to debug, so as not to cause more trouble connection.

Tips for modifying SSH remote connection ports for Linux

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.