A comprehensive guide to setting up your new Linux VPS, including initial configuration and basic commands.
Introduction
Welcome to your new Linux VPS! This guide will walk you through the initial setup process, ensuring your server is ready for use. Whether you are new to Linux or an experienced user, these steps will help you get started quickly and efficiently.
Step 1: Accessing Your VPS
Accessing your VPS is the first step to getting started with your new server.
Connect via SSH:
Use an SSH client like PuTTY (Windows) or Terminal (macOS/Linux) to connect to your VPS.
ssh root@your_vps_ip
This command initiates an SSH connection to your VPS.
Enter Your Password:
When prompted, enter the root password provided by your hosting provider. This step authenticates your connection to the VPS.
Step 2: Update Your Server
Updating your server ensures you have the latest security patches and software updates.
Update Package Lists:
sudo apt update
This command updates the package lists for the repositories.
Upgrade Installed Packages:
sudo apt upgrade -y
This command upgrades all installed packages to their latest versions.
Step 3: Create a New User
Creating a new user with sudo privileges is a best practice for security.
Add a New User:
adduser newusername
This command creates a new user.
Grant Sudo Privileges:
usermod -aG sudo newusername
This command adds the new user to the sudo group, granting administrative privileges.
Step 4: Secure Your Server
Securing your server is essential to protect it from unauthorized access.
Disable Root Login:
sudo nano /etc/ssh/sshd_config
Find the line PermitRootLogin
and change its value to no
. This step disables root login via SSH.
Restart SSH Service:
sudo systemctl restart ssh
This command restarts the SSH service to apply the changes.
Conclusion
Your Linux VPS is now set up and secured. You can start installing software, configuring services, and more. By following these steps, you’ve ensured that your server is both functional and secure. Happy hosting!