Setting up a Linux VPS

Remote access the server as root

ssh root@<ip_address>

Enter the password and you are in. Of course, you need to know the password to begin with. The hosting provider that you purchased the VPS from should have securely provided this to you.

To change root’s password do

passwd root

And enter a new password.

Add a new user

useradd -s /bin/bash -m -c "Jimmy Sweeney" -G sudo sweenejp

Then set a password with

passwd sweenejp

Remote acces the server with an ssh key

Exit the server. Then create an ssh key if one does not already exist. Copy the public ssh key to the remote server with

ssh-copy-id sweenejp@<ip_address>

You could do the same with root but I plan on using the sweenejp user at this point on anyway.

Now you should be able to ssh into the server without having to enter a password each time.

ssh sweenejp@<ip_address>