This guide shows you how to log in to your VPS via SSH and gain root access. You'll learn how to connect with your username and password, and then elevate your privileges to root level.
How to do it
-
Step 1: Log in with your VPS credentials
Connect to your VPS using SSH with the username and password that were created for this VPS.
Example command:
ssh username@your-vps-ip -
Step 2: Set a root password
Once logged in, set a password for the root user by running:
sudo passwd rootEnter and confirm your new root password when prompted.
-
Step 3: Switch to root user
After setting the root password, you can switch to the root user by entering:
suEnter the root password you just created. You are now logged in as the root user.