Linux Server modify SSH default 22 port method

Source: Internet
Author: User

1. Log in to the server and open the Sshd_config file

# Vim/etc/ssh/sshd_config

2, find #port 22, the default is commented out, the first # to remove, and then insert a line to set the port number you want, be careful not to repeat with the existing port number

# The strategy used for options on the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. uncommented Options Change A
# default value.

Port 22
Port 26580

3. Exit after saving, execute restart command

#/etc/init.d/sshd Restart

4, a new terminal window test 23456 whether the port can be properly connected to the server, if successful, the port 22 is deleted, the reason is set to two ports, test success and then close a port, is in order to modify the Conf process, in the event of a drop line, broken network, misoperation, such as unknown circumstances, can also be connected through another port to debug to avoid the connection does not have to send people to the computer room, causing problems more complicated trouble.

Linux Server modify SSH default 22 port method

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.