How to enable logins with the root user via SSH
Find out to configure SSH to allow root logins
Find out to configure SSH to allow root logins
Last updated 19th September 2020
To perform certain administrative functions on your server (e.g. installing packages), you’ll need to have a high level of user access. On Linux servers, this access is called “root”.
This guide provides some basic information on how to enable root logins via SSH.
While OVHcloud provides you with the devices, the responsibility rests solely in your hands. Since we have no access to these machines, we are not their administrators. It is your responsibility to manage the software, and apply proper security measures on a daily basis. This guide is designed to help you with the most common tasks. Nevertheless, we recommend that you contact a specialised service provider if you have difficulties or doubts concerning the administration, usage or implementation of security measures on a server.
To become the root user, type the following command at the command line:
~$ sudo su -
~#
You should be prompted for your current password to change users.
Now that you are the root user, you can set a password for it.
~# passwd
New password:
Retype new password:
passwd: password updated successfully
You will need to configure the SSH service to allow root logins.
Enabling root logins is not recommended as it will open your server to brute force attacks. We recommend taking measures to secure your VPS first. You can refer to our guide on Securing a VPS
You need to use a text editor such as vim or nano.
~# vi /etc/ssh/sshd_config
Add the following line to allow root logins.
PermitRootLogin yes
Save the file
~# systemctl restart ssh
You should now be able to login with the root user.
Join our community of users on https://community.ovh.com/en/.
Please feel free to give any suggestions in order to improve this documentation.
Whether your feedback is about images, content, or structure, please share it, so that we can improve it together.
Your support requests will not be processed via this form. To do this, please use the "Create a ticket" form.
Thank you. Your feedback has been received.
Access your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.
Discuss with the OVHcloud community