• Home
  • WordPress
  • Hosting
    • Budget Hosting
    • Business Hosting
    • Email Hosting
    • Reseller Hosting
  • Domain
    • Domain Pricing
  • Servers
    • Dedicated Servers
    • Vps Servers
  • Security
    • SSLs
      • Domain Validation SSL
      • Extended Validation SSL
      • Organization Validation SSL
      • Wildcard SSL
    • Fix Hacked Website
xoftmade-logo xoftmade-logo
  • Home
  • WordPress
  • Hosting
    • Budget Hosting
    • Business Hosting
    • Email Hosting
    • Reseller Hosting
  • Domain
    • Domain Pricing
  • Servers
    • Dedicated Servers
    • Vps Servers
  • Security
    • SSLs
      • Domain Validation SSL
      • Extended Validation SSL
      • Organization Validation SSL
      • Wildcard SSL
    • Fix Hacked Website
Client Area

How to enable or disable root user login in Linux Servers?

by xoftmade
November 17, 2025
Almalinux, CentOS, Debian, Linux, Ubuntu

In Linux Servers Root User means the Administrator User who control everything in the server. So as a root user there is a big responsibility comes with it, it must be protected. By default root user may be disabled in Different Linux Operating Systems like AlmaLinux, Ubuntu etc.

So to access Linux login you have to go through different default username like (Almalinux) then you have to enter (sudo -i) for root access.

And before that you must have to set a password for root user, to enable root login on your Linux server, first you need to set up password for your root user as it is not set during the OS installation.

Use following command to set root password:

sudo passwd root

This command will prompt to enter a new password then confirm password etc, it will update the root password. (Always use a strong password including special characters and password must be longer than 12 characters.)

#sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Now you have to enable root access as default, for this edit SSH configuration file and enable root login in it.

nano /etc/ssh/sshd_config

Find the line that starts with PermitRootLogin and make sure that line is not commented.

OLD: #PermitRootLogin prohibit-password

Change it to:
PermitRootLogin yes

Makesure to save the change in this file. And now you have to restart the SSH service, that restart will enable your changes.

Now you can access your server with root user as normal.

To disable the root user again you have to edit SSH Configuration file (/etc/ssh/sshd_config) and revert the change mentioned above.

Share:

Recent Posts

  • Critical cPanel & WHM Authentication Flaw Allows Remote Takeover – Patch Now
  • Now SSLs will Expire in Just 200 Days why!
  • How to disable alt-php binaries from cPanel MultiPHP Manager
  • How to enable or disable root user login in Linux Servers?
  • How to install CSF Firewall when Configserver closed the firewall

Recent Comments

No comments to show.
xoftmade-logo
P50 Plaza, 2nd Floor, Chenab Market, Susan Road, Faisalabad
+92 311 4991414

sales@xoftmade.com

Hosting
  • Managed WordPress Hosting
  • Budget Hosting
  • Business Hosting
  • Email Hosting
  • Reseller Hosting
Company
  • About
  • Blog
  • Affiliate Marketing
  • Terms of Service
  • Contact
Domains
  • Domain Search
  • Domain Pricing
  • WHOIS Lookup
Join Our Newsletter

We’ll send you news and offers.

Social Media
Facebook-f Instagram
© All Rights Reserved - Xoftmade Web Solutions