Creating And Configuring A Remote Server
Connecting To A Created Server
Using SSH
Connect to the server via SSH using the below standard format, port number (if available), and the root credentials that were created when the server was created (if available):
ssh root@A.B.C.D:E
Perform Any Available System Updates
There are likely several updates that need to be performed to bring the system up to date upon creation, use the below:
Ubuntu/Debian
apt update && upgrade
CentOS/RHEL/Fedora
dnf upgrade
Setting Timezone
New servers are set to UTC by default, use the below to change the timezone to local time if desired.
List the available timezones:
timedatectl list-timezones
Set the desired timezone:
timedatectl set-timezone 'TIMEZONE_NAME_FROM_LIST'
Verify timezone has been set:
date
Custom Hostname
Setting a hostname can be done using the below:
hostnamectl set-hostname CUSTOM_HOSTNAME
Try to create something specific, relevant, and memorable. i.e. web-01-prod wiki-01-staging
The terminal may not update right away, and you may need to log out and back in to see the changes reflected.
hostname can be used to see the currently configured hostname without logging out and back in.
Creating Non-Root Users
It's not advisable to use the unlimited access of the root account at all times, and the root account should not be permitted to access the server remotely. Create a limited-user account for the day-to-day tasks that will be performed instead using the below:
Ubuntu/Debian
Create the user:
adduser EXAMPLE_USERNAME
Grant the user sudo privileges:
adduser EXAMPLE_USERNAME sudo
CentOS/RHEL/Fedora
Create the user and set a password for that user:
useradd EXAMPLE_USER && passwd EXAMPLE_USER
Grant the user sudo privileges:
usermod -aG wheel EXAMPLE_USER
Logging In As The New User
Use the exit command to log out of the server, and repeat the steps from 'Connecting To A Created Server' using the credentials for the new user:
ssh EXAMPLE_USER@A.B.C.D:E
Followed by entering the password set for this user.