VPS Setup Record - Basics

Just upgrade my VPS to CentOS 7 and it cleans up everything. In case I forgot it, here I record what I did step by step.. hopefully it'll be useful to everyone on the web too! 😀

I'll start with some very basic stuff. Notice that different Linux distribution has different commands.

My VPS Info

  • Linux Distribution: CentOS 7 x86_64
  • RAM: 768MB
  • Disk Space: 15GB SSD
  • Bandwidth: 200GB
  • Location: Tokyo

Basic Settings

The first thing after VPS is setup is changing the hostname and create a new account for self. Open the terminal/putty if using Unix/Windows, login the VPS via ssh root@happyz.me (demo only, you will want to disable remote login with root user, will talk about how later). Typing hostnamectl status will print out the current hostname. And changing the hostname is as simple as:

hostnamectl set-hostname happyz.me

By starting a new session (e.g. logout and then login), we can verify the new hostname by hostnamectl status. Isn't that simple? Adding a user is also simple:

useradd -m happyz

Then change the password via:

passwd happyz

Grant the sudo access to this user happyz is by:

echo "happyz ALL=(ALL) ALL" >> /etc/sudoers.d/happyz

Now exit and login via ssh happyz@happyz.me to test if it's successful. It will pop up and ask you the password just we just set. Tah-Dah!

The following context assumes the login user is root.

Updates and Software Installation

It's time to update and install softwares as if we are using our personal computers. Simply do an update via:

yum -y update

And in my mind, vim nano is one of the most powerful editors. It's fast and small. Probably it's preinstalled, but it won't bother much by just typing:

yum -y install nano

If you need git like I do, just do:

yum -y install git

Miscellaneous Stuff

We can also set the timezone for our VPS. Mine is America/Los_Angeles and you can look it up by timedatectl list-timezones. And then do:

timedatectl set-timezone America/Los_Angeles

Leave a comment

Your email address will not be published. Required fields are marked *