Prohibiting the root User to Remotely Log In to the System
The root user is the administrator of the Linux OS and has the permission to access all Linux system resources. Allowing direct root logins to perform system operations poses potential security risks. Generally, it is advised to set the PermitRootLogin parameter to no in the /etc/ssh/sshd_config file. Once configured, the root user cannot log in to the system using SSH, thereby enhancing system security. If you want to use the root permission to perform management operations, you can log in to the system as a common user and run the su or sudo command to switch to the root user. This can avoid logging in to the system directly with the root user, thereby reducing the risks of system attacks.
Parent topic: Security Hardening