Modify ssh port

Source: Internet
Author: User
The modification is the/etc/ssh/sshd_config file. (The first modification is the ssh_config file. The result is that the SSH service is restarted. Why didn't it take effect? I still wondered. Then I ran in Google and the answer came out.
[Root @ Linux ~] # Vi/etc/ssh/sshd_config
# $ OpenBSD: sshd_config, V 1.69 2004/05/23 23:59:53 dtucker exp $

# This is the sshd server system-wide configuration file. See
# Sshd_config (5) for more information.

# This sshd was compiled with Path =/usr/local/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped
# OpenSSH is to specify options with their default value where
# Possible, but leave them commented. uncommented options change
# Default value.

Port 2222 // In the past, there was a number # in front of it, and the default value is 22. It will be OK after modification.
# Protocol 2, 1
# Listenaddress 0.0.0.0
# Listenaddress ::

# Hostkey for Protocol Version 1
# Hostkey/etc/ssh/ssh_host_key
# Hostkeys for Protocol Version 2
# Hostkey/etc/ssh/ssh_host_rsa_key
# Hostkey/etc/ssh/ssh_host_dsa_key

4. Restart the SSH service. The modified port takes effect.
[Root @ Linux ~] # Service sshd restart
Stopping sshd: [OK]
Starting sshd: [OK]
[Root @ Linux ~] #

5. Run the netstat-An command to check whether it is correct.

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.