Ensure SSH security in Linux-Linux Enterprise Application-Linux server application information. The following is a detailed description. Source: Saidi net Author: freedom
SSH is a good way to remotely manage a server. However, SSH still has many problems. Communication between the server and the client is secure, but this does not mean that the involved host is secure. Opening an SSH service to the outside world means that a strong attack is allowed.
We can adopt some extremely simple methods to truly enhance remote access via SSH, especially when we cannot associate this service with a limited number of source ports.
Let's talk about an important thing, sshd_config. In Ubuntu, this is usually found in/etc/ssh and can be used to configure a large number of features. The simplest is often the best. Limiting users who can log on via SSH is a primary principle. You can use either the user or group. AllowGroups allows any authenticated users in a group to access the server through SSH. However, a more refined method is to use the AllowUsers option.
Another simple method is to move the listening port from port 22 to another randomly specified port. This reduces the possibility of displaying SSHD running status scans.
We can also disable access to the root and Disable password verification instead of key verification.
The next step is to use a small tool called Denyhosts, which can be downloaded from http://denyhosts.sourceforge.net. Make sure to enable the resources in/etc/apt/source. list and type the following command:
DenyHosts is intended to be run by the Linux system administrator to help it defeat an attempt to attack the SSH server (also known as a dictionary-based attack or a powerful attack.
DenyHosts acts as a dynamic blocker for SSH and other services. It relies on/etc/hosts. deny and hosts. allow works and can dynamically build a list of hosts that are repeatedly connected to our servers. By default, this service will block IP address sources from constantly attempting to connect to our host and implement access. The processing of Denyhosts is configured in/etc/denyhosts. conf.
We can also use Iptables (see the author's Iptables in the world of network administrators) to limit the connection speed, and we should also deploy a firewall on the server.
Once these settings are stopped, we will be confident that we have a more secure SSH on a public-facing host.
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