Ubuntu Linux: How to Login as root User


tl;dr: root user is disabled by default. Make use of sudo to perform administrative tasks with elevated privileges.

If you are on a Ubuntu Linux distribution system and want to login as root user, then the first thing you should know is "the root user is disabled by default in Ubuntu for security reason" - Read the official page: https://help.ubuntu.com/community/RootSudo

So the su - command will not work.

But, If you are a part of the sudoer group (sudo) then you can make use of the sudo command to perform administrative tasks with elevated privileges.


Examples:
# sudo apt install python3

[sudo] password for mike: 
Reading package lists... Done
...
# sudo nano /etc/nginx/nginx.conf
Ubuntu Linux Login as root user
-

Facing issues? Have Questions? Post them here! I am happy to answer!


Author: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap