Many Webmasters have linux Hosts, whether they are virtual machines or physical machines. Generally, we use ssh (SecureShell is based on the security protocol at the application layer and Transport Layer) for remote connection ).
Its default port is 22, and root is used by default. This is a very dangerous thing on the Internet. We can only disable root logon by changing its default port (although it will still be detected by port scanning) to improve security.
1.Modify the default ssh port
A. Temporary modification of the command line
In Linux, the default SSH port is 22. For security reasons, modify the SSH port to 1433 as follows:
/Usr/sbin/sshd-p 1433
B. modify the configuration file permanently.
Vi/etc/ssh/sshd_config
Then, change the value to port 8888.
2.Service sshd restart (redhat as3) as root)
3.Use putty and port 8888 for remote connection.
To enhance security
First, add a user with normal permissions:
# Useradd sshuser
# Passwd sshuser
// Set the password. It must be a complex password. Use the notebook to write it down so that you do not forget it.
The production machine prohibits ROOT remote SSH login:
# Vi/etc/ssh/sshd_config
Set
PermitRootLogin yes
Change
PermitRootLogin no
Restart sshd service
# Service sshd restart
Remote Management: Use sshuser as the common user to log on, and then use su root to switch to the root user to obtain the highest permission.