Linux highest-Privileged user root, which can be directly logged into sshd by default. In order to improve the security of the server, it is necessary to prohibit it, so that the attacker can not be brute force to gain root privileges.
1, create a new user;
#useradd xxx (XXX for you to create a new username)
2, set the password for the new user;
#passwd xxx (XXX for you to create a new username)
3, modify sshd configuration, disable root direct login
#vi/etc/ssh/sshd_config
Look for "#PermitRootLogin yes", remove the previous "#", and the short tail "yes" to "No" and save the file.
4, after the modification, restart the sshd service
#service sshd Restart
5, the next login, first use the xxx login, and then through the SU root to obtain root privileges.
Modifying the sshd default port
Although changing a port does not fundamentally protect against port scanning, it can improve defense to some extent.
1. Open the sshd configuration file
#vi/etc/ssh/sshd_config
2. Locate the #port 22 field to delete # and change the 22 to another unused port
Server port can be up to 65536 maximum
3. Restart the SSHD service
#service sshd Restart
4. Don't forget to change the port settings on the login tool.
Linux prohibits the root user from logging directly into sshd and modifies the default port