The new purchase VPS should do a few things

Source: Internet
Author: User
Tags vps

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.