Basic settings have the following steps: 1. Modify the ssh port number 2. Set the complex root password 3. Disable root remote login 4. Use the script to automatically deny the password error x times ip (this number of x can be defined according to the actual situation)
First give you a piece of code to detect if your vps has been brute force:
cat /var/log /secure|
Awk '/Failed/{print $(NF-3)}'|
Sort|
Uniq -c|
Awk '{print $2"="$1;}'
If the result of the query contains the result of "ip address=number”, then it means someone tried to crack your password.
The following describes how to change the ssh port number and how to disable root remote login:
First, change the ssh port number
VPS default ssh port is 22, use the following command to enter Configuration file
vi /etc/ssh/sshd_config
Find #port 22 Remove the previous #, and then modify the port port 12345 (the port here can be defined according to the actual situation) and then restart ssh Service
service sshd restart
Second, disable root login
Before disabling root login, you must first add a user with normal privileges and set the password
useradd testpasswd test
Then disable ROOT remote SSH login:
vi /etc/ssh/sshd_config
Change PermitRootLogin yes to PermitRootLogin no
If you have # in front of PermitRootLogin, you must also delete it, otherwise it will not take effect.
Restart sshd service
service sshd restart
We can connect to our vps through normal ssh account. If you need administrative rights, you can use the following command. Promote to root privileges
su root
lftp is an ftp client under Linux for logging in to a remote FTP server. Use its mirror command to b
This article mainly introduces the DB2 database in the inux installation process detailed, the step
1. Lock the redundant self-built account in the systemCheck method:Execute the command#cat /etc/pas
Format: printf("\\033[word background color; font color m string \\033[0m" ); printf("
Fedora 15 installed nvidia driver
How to get the absolute path of the configuration file in Linux
How Linux uses inode to delete files
Basic knowledge of Linux distributions and installations
The meaning and difference between Linux chmod 755 and chmod 777
Shell programming condition test
Linux can use mencoder to extract the audio in the video
Easily switch the language of mac apps
Linux command line to modify IP 2 methods
Linux/VPS CentOS yum download slow? Install the Axel plugin to speed up the look
Win7 system using Windows DVD Maker to create a CD tutorial to share
2000/XP can not delete the file solution
Win7 system plays web video without sound solution
How to open stp file What format file stp is
Win7 system small speaker red fork can not be used how to do?
FlashGet's three "part-time" features
How to use Win7 system to build a hidden virtual wireless network card
Win10 official version prompts "Error 0x80200056" solution
How to hide the administrator username of Win7 login interface