Install and configure an SSH server in CentOS

Source: Internet
Author: User

Install and configure an SSH server in CentOS

SSH is the default protocol for Linux Remote Management. SSH is one of the most important software installed and running on the minimal CentOS server.

Check the installed SSH version.

# SSH-V

Check the SSH Version

Use a safer SSH protocol instead of the default protocol, and change the port number to further enhance security. Edit the SSH configuration file '/etc/ssh/ssh_config '.

Remove the comment in the following line or delete 1 from the Protocol line, and then the line looks like this (LCTT: SSH v1 is an out-of-date insecure protocol ):

# Protocol 2, 1 (originally)
Protocol 2 (now)

This change forces SSH to use Protocol 2, which is considered safer than Protocol 1, and also ensures that the port number 22 is changed to another in the configuration.

Protect SSH Login

Cancel the 'root login' in SSH. You can use the su to switch to the root account only after logging on with a common user account. This further enhances security. Open and edit the configuration file '/etc/ssh/sshd_config' and change PermitRootLogin yes to PermitRootLogin no.

# PermitRootLogin yes (originally)
PermitRootLogin no (now)

Cancel SSH Root Login

Finally, restart the SSH service to enable the changes.

# Systemctl restart sshd. service

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.