Root access provides complete control over your VPS, allowing you to install software, modify system settings, and manage user accounts. With root access, you can perform tasks that are otherwise restricted or unavailable to standard users. However, root access also comes with potential risks. It’s important to understand the responsibilities that come with root access and take the necessary precautions to secure your VPS.
Before you enable root access on your OVH VPS, ensure you have the following:
- An active OVH VPS subscription
- The IP address, username and password for your VPS, which can be found in your OVH account
- A Secure Shell (SSH) client, such as PuTTY for Windows or Terminal for macOS and Linux
Step 1: Connect to your VPS
Using your preferred SSH client, connect to your VPS using the IP address and root password provided in your OVH account.
For example, in Terminal, you would enter:
ssh username@your_vps_ip_address
STEP 2: CHANGE ROOT PASSWORD
To change the root password, enter the following command:
sudo passwd root
You’ll be prompted to enter a new password for the root user. Type your new password and press Enter and you will be asked to re-enter your new password to confirm it. Type the password again and press Enter. If the passwords match, you’ll receive a message indicating that the password has been updated successfully.
Step 3: Modify the SSH configuration
Once connected, open the SSH configuration file with a text editor, such as nano:
sudo nano /etc/ssh/sshd_config
In the configuration file, locate the line containing “PermitRootLogin” and set the value to “yes”:
PermitRootLogin yes
If the line is commented out with a “#” symbol, remove the symbol to activate the setting.
After that, search for the line containing “PasswordAuthentication.” Change the value to “yes” to enable password authentication:
PasswordAuthentication yes
After making the changes, save and exit the configuration file. In nano, press “Ctrl + X,” then “Y,” followed by “Enter.”
Step 4: Restart the SSH service
To apply the changes, restart the SSH service with the following command:
sudo service sshd reload
With root access enabled, you can now connect to your VPS as the root user. Use your SSH client and the root password provided in your OVH account to establish a connection. Remember to use caution when executing commands as the root user, as it can potentially damage your VPS or compromise its security.
1 Comment