Free site migration on web hosting plans

ADVEYER
USD / TRYToday's rate (12 November 2026). TRY prices are worked out with it. 50.21 ₺

How to Enable the Root User on a Linux Server

Enable the root user on a Linux server you access with a sudo user, and allow root login over SSH.

Estimated Time
5 minutes
Difficulty
Intermediate
Steps
5 steps
Last Updated
Linux terminal switching to root with sudo -i, next to a shield standing for root access
On This Page

This guide explains how to enable the root user on your Linux server.

Requirements

  • A server with a Linux operating system installed
  • You are logged in over SSH with a user that has sudo privileges

Steps

0 of 5 steps done

  1. Step 1: Log In with SSH

    Connect to your server over SSH using the user details shown in your customer panel.

  2. Step 2: Switch to Root

    Once logged in, switch to root with this command:

    bash
    sudo -i
  3. Step 3: Set a Root Password

    The root user is disabled by default. Set a new root password:

    bash
    passwd

    You will be asked to enter the password twice.

  4. Step 4: Allow Remote Root Login

    Remote root login over SSH is disabled. You can enable it by editing the /etc/ssh/sshd_config file. Change this line:

    Code
    PermitRootLogin without-password

    to:

    Code
    PermitRootLogin yes
  5. Step 5: Restart the SSH Service

    Restart the SSH service for the new setting to take effect:

    bash
    systemctl restart sshd

    On some distributions the service is called ssh; in that case use systemctl restart ssh.

You have now enabled the root user on your Linux server.

Cloud VPS

Flexible virtual servers located in Türkiye

Starting Price

$4.99/mo

View Plans

Frequently Asked Questions

Why is the root user disabled by default?

The root user is disabled by default and cannot log in remotely over SSH. To enable it, you first set a root password and then change the SSH setting.

Is it safe to enable root login?

Root login with a password increases the risk of attacks. Where possible, allow root login with an SSH key only and disable password login.

Was This Guide Helpful?

Related Guides