Modify SSH default port number under Linux __linux

Source: Internet
Author: User
Tags ssh

1. Introduction

For system security, it is sometimes necessary to modify the SSH default port. The modification method is as follows:

Vim/etc/ssh/sshd_config
Add two port

# $OpenBSD: sshd_config,v 1.69 2004/05/23 23:59:53 dtucker EXP $
# This is the SSHD server system-wide configuration file. The
# Sshd_config (5) for the more information.
# This sshd is compiled with Path=/usr/local/bin:/bin:/usr/bin
# The strategy used for options in 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//Before this, there's a # number in front.
Port 8284

#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


Restart the sshd service

/etc/init.d/sshd restart


If the firewall is turned on, you need to modify the firewall settings.



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.