My customer accountContact SalesWebmailOVHcloud Blog

Welcome to OVHcloud.

Log in to order, manage your products and services, and track your orders

Log in

How to enable logins with the root user via SSH

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.


  • A service (VPS, Dedicated Server, Public Cloud Instance) that currently does not have root logins enabled.


Become root

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.

Set the root password

Now that you are the root user, you can set a password for it.

~# passwd
New password: 
Retype new password: 
passwd: password updated successfully

Enable root logins

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

Open the sshd_config file

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

Restart the SSH service

~# systemctl restart ssh

You should now be able to login with the root user.

Go further

Securing a VPS

Join our community of users on

Did you find this guide useful?

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.

OVHcloud Community

Access your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.

Discuss with the OVHcloud community