1. Change the root password
passwd Root
2. Create a new user
Useradd Vinentguo
3. Configure password-free login. use the new user to login to the VPS.
mkdir ~/.ssh/
Chmod-r ~/.ssh/
Touch ~/.ssh/authorized_keys && chmod 644 ~/.ssh/authorized_keys
Put the public key in the new Authorized_keys file
4. Disable Root Login
sudo vim/etc/ssh/sshd_config
Change Permitrootlogin to No
5. Mount the disk (switch to root account) Brother's data is gone, pay attention to
Fdisk/dev/sdb
Enter n New partition
Input P
Enter 1 to set the primary partition
Enter
Enter
Enter P to view the partition
Input W Save partition
Yum Install E4fsprogs
Mkfs.ext4-e LAZY_ITABLE_INIT=1/DEV/SDB1
Mkdir/web #创建目录;
echo "/dev/sdb1/web ext4 defaults,noatime,nodiratime 0 0" >>/etc/fstab #修改系统配置文件
Mount-a
Df-lh
The above command is basically possible, but the mounted directory is noted, I was mounted in the data directory, because the data directory already exists, after the direct mount, and it is not available. , pay attention to
6. Configure time synchronization (switch to root)
Crontab-e
Ten */1 * * * ntpdate time.nist.gov
7. Firewall settings (switch to root account)
/sbin/iptables-i input-p TCP--dport 80-j ACCEPT
/sbin/iptables-i input-p TCP--dport 22-j ACCEPT
/sbin/iptables-i input-p TCP--dport 3310-j ACCEPT
/etc/rc.d/init.d/iptables Save
/etc/init.d/iptables restart
The original address: The new purchase VPS should do a few things
The new purchase VPS should do a few things