To modify the sshd default port _linux

Source: Internet
Author: User

The specific steps are as follows:

Modifying a configuration file

Copy Code code as follows:

Vi/etc/ssh/sshd_config

Find "Port 22", remove the annotation, and change to the new port number, for example:

Copy Code code as follows:

Port 22342

Then save the exit, be sure to remember this port number, or once you exit the current client will not be connected.

Two restart sshd

Copy Code code as follows:

/etc/init.d/sshd restart

The new port will be in effect at that time, but the current connection will not be disconnected

Three verify that the new port is open

Copy Code code as follows:

Telnet 1.2.3.4 22342

Prompt "ssh-2.0-openssh_x.x" to indicate that it has been in effect, if the prompt "can not open to the host connection, in the port xxxxx: Connection Failed" to explain that the modification failed, and then look for reasons.

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.