Basic reinforcement and optimized configuration necessary for online Linux server system

1. System security overview

Common types of system attacks:

  • Password brute force attack;
  • Denial of service attack (DDoS);
  • Application vulnerability attack (horse hanging, SQL injection);

Attack prevention strategy:

1. Password login security

Common security policies:

  • Complex password + normal user ssh login;
  • Remote login via key authentication;

openssh configuration file /etc/ssh/sshd_config, pay attention to the following configuration items:

Port 22
AuthorizedKeysFile      .ssh/authorized_keys
PermitRootLogin no
GSSAPIAuthentication no
UseDNS no

2. Port and service security
Under the Linux operating system, the system defines a total of 65,536 available ports. These ports are divided into two parts, with 1024 as the split point, which are "ports that can only be enabled by root users" and "clients". The port of the terminal": 0-1023 ports, all need to be enabled as root, you can get the corresponding list of ports and services by consulting the /etc/services file under linux.

For example, ports 20 and 21 are reserved for ftp services, port 23 is reserved for telnet services, port 25 is reserved for mail services, and port 80 is reserved for www services.

1024 or more (package

Guess you like

Origin blog.csdn.net/qq_35029061/article/details/131972082