• About
  • Contact
  • Cookie
  • Disclaimer
  • Privacy Policy
  • Change the purpose of use

Tnhelearning.edu.vn - Various useful general information portal

  • Photo
  • Bio
  • How To
  • Tech

How to Get Root on Ubuntu

November 4, 2023 by admin Category: How To

You are viewing the article How to Get Root on Ubuntu  at Tnhelearning.edu.vn you can quickly access the necessary information in the table of contents of the article below.

X

This article is co-authored by a team of editors and trained researchers who confirm the accuracy and completeness of the article.

The wikiHow Content Management team carefully monitors the work of editors to ensure that every article is up to a high standard of quality.

This article has been viewed 53,003 times.

To perform administrator tasks on Linux, you must have root access (superuser or superuser). Having a separate root account is common on most Linux distros, but Ubuntu disables superuser permissions by default. This is to prevent you from accidentally making errors and keep your system safe from suspicious intruders. To execute a command that requires root access, use sudo .

Table of Contents

  • Steps
    • Execute root with sudo . command
    • Advanced User Activation
  • Advice

Steps

Execute root with sudo . command

Image titled Become Root in Ubuntu Step 1

Image titled Become Root in Ubuntu Step 1

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/d/d7/Become-Root-in-Ubuntu-Step-1-Version-5.jpg/v4-728px-Become-Root- in-Ubuntu-Step-1-Version-5.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/d/d7/Become-Root-in-Ubuntu-Step-1- Version-5.jpg/v4-728px-Become-Root-in-Ubuntu-Step-1-Version-5.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
Press Ctrl + Alt + T to open a terminal window. Because Ubuntu locks the root account by default, you cannot use the su command to become a super user like in other Linux distros. [1] X Research Sources Instead, start your command with sudo .
Image titled Become Root in Ubuntu Step 2

Image titled Become Root in Ubuntu Step 2

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/2/20/Become-Root-in-Ubuntu-Step-2-Version-5.jpg/v4-728px-Become-Root- in-Ubuntu-Step-2-Version-5.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/2/20/Become-Root-in-Ubuntu-Step-2- Version-5.jpg/v4-728px-Become-Root-in-Ubuntu-Step-2-Version-5.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
Type sudo before the command. “Sudo” stands for “Super User Do.” When you use sudo to start a command, the command will be executed as a super user.

  • For example, the sudo /etc/init.d/networking stop command will stop the network service, while the sudo adduser command will add a new user to the system. These tasks all require super user permissions.
  • You will be asked for your password before sudo executes the command. Linux will save your password for 15 minutes, so you don’t have to enter it again and again.
READ More:   How to Identify Genuine Leather
Image titled Become Root in Ubuntu Step 3

Image titled Become Root in Ubuntu Step 3

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/0/08/Become-Root-in-Ubuntu-Step-3-Version-5.jpg/v4-728px-Become-Root- in-Ubuntu-Step-3-Version-5.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/0/08/Become-Root-in-Ubuntu-Step-3- Version-5.jpg/v4-728px-Become-Root-in-Ubuntu-Step-3-Version-5.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
Enter gksudo before executing the command to open a program with a graphical user interface (GUI for short). For security reasons, Ubuntu does not recommend using “sudo” to open programs in the GUI. [2] X Research Resources Instead, enter gksudo before the command that starts the program.

  • For example, you can type gksudo gedit /etc/fstab to open the file “fstab” with the Gedit editor in the GUI.
  • If you use KDE Window Manager, use kdesudo instead of gksudo .
Image titled Become Root in Ubuntu Step 4

Image titled Become Root in Ubuntu Step 4

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/6/62/Become-Root-in-Ubuntu-Step-4-Version-5.jpg/v4-728px-Become-Root- in-Ubuntu-Step-4-Version-5.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/6/62/Become-Root-in-Ubuntu-Step-4- Version-5.jpg/v4-728px-Become-Root-in-Ubuntu-Step-4-Version-5.jpg”,”smallWidth”:460,”smallHeight”:346,”bigWidth”:728,”bigHeight” :548,”licensing”:”<div class=”mw-parser-output”></div>”}
Emulate a high-level user environment (root shell). If you are an advanced user that needs real root shell access to execute specific scripts, you can simulate an advanced user environment with sudo –i . This command will give you super user access to root’s environment variables. [3] X Research Sources

  • Enter the command sudo passwd root to create a root password, which essentially “activates” the account. Do not forget this password.
  • Type sudo -i . Then enter the root password when prompted.
  • The command line interpreter will change from $ to # , which means you already have root access.
Image titled Become Root in Ubuntu Step 5

Image titled Become Root in Ubuntu Step 5

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/f/f0/Become-Root-in-Ubuntu-Step-5.jpg/v4-728px-Become-Root-in-Ubuntu- Step-5.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/f/f0/Become-Root-in-Ubuntu-Step-5.jpg/v4-728px-Become- Root-in-Ubuntu-Step-5.jpg”,”smallWidth”:460,”smallHeight”:346,”bigWidth”:728,”bigHeight”:548,”licensing”:”<div class=”mw-parser -output”></div>”}
Grant sudo access to another user. If you’re setting up an account for someone who doesn’t have root privileges, you need to add their username to the sudo group. To proceed, type usermod -aG sudo username (replace “username” with a specific username). [4] X Research Sources

Advanced User Activation

Image titled Become Root in Ubuntu Step 6

Image titled Become Root in Ubuntu Step 6

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/5/5f/Become-Root-in-Ubuntu-Step-6.jpg/v4-728px-Become-Root-in-Ubuntu- Step-6.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/5/5f/Become-Root-in-Ubuntu-Step-6.jpg/v4-728px-Become- Root-in-Ubuntu-Step-6.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Press Ctrl + Alt + T to open a terminal window. For security purposes (and avoid damage), premium user accounts are always locked by default. To safely execute commands as a super user, you should use sudo or gksudo instead. If you absolutely must have a separate root account (as is the case with a request from some program your business uses, or this dedicated computer is only used by a single user), you can activate the super user account with some simple commands.

  • Ubuntu does not recommend activating the super user account because this can bring risks to the system. [5] X Research Sources
READ More:   How To Get Your Voice Back After It's Lost
Image titled Become Root in Ubuntu Step 7

Image titled Become Root in Ubuntu Step 7

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/1/1f/Become-Root-in-Ubuntu-Step-7.jpg/v4-728px-Become-Root-in-Ubuntu- Step-7.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/1/1f/Become-Root-in-Ubuntu-Step-7.jpg/v4-728px-Become- Root-in-Ubuntu-Step-7.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Type sudo passwd root and press ↵ Enter . You will be asked to set a new password for the premium user account. [6] X Research Source Remember this password.
Image titled Become Root in Ubuntu Step 8

Image titled Become Root in Ubuntu Step 8

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/2/2e/Become-Root-in-Ubuntu-Step-8-Version-2.jpg/v4-728px-Become-Root- in-Ubuntu-Step-8-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/2/2e/Become-Root-in-Ubuntu-Step-8- Version-2.jpg/v4-728px-Become-Root-in-Ubuntu-Step-8-Version-2.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
Enter the password, then press ↵ Enter .
Image titled Become Root in Ubuntu Step 9

Image titled Become Root in Ubuntu Step 9

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/4/44/Become-Root-in-Ubuntu-Step-9.jpg/v4-728px-Become-Root-in-Ubuntu- Step-9.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/4/44/Become-Root-in-Ubuntu-Step-9.jpg/v4-728px-Become- Root-in-Ubuntu-Step-9.jpg”,”smallWidth”:460,”smallHeight”:347,”bigWidth”:728,”bigHeight”:549,”licensing”:”<div class=”mw-parser -output”></div>”}
Retype the password when prompted, then press ↵ Enter . So the super user account has a password.
  • Image titled Become Root in Ubuntu Step 10

    Image titled Become Root in Ubuntu Step 10

    {“smallUrl”:”https://www.wikihow.com/images_en/thumb/d/d2/Become-Root-in-Ubuntu-Step-10-Version-2.jpg/v4-728px-Become-Root- in-Ubuntu-Step-10-Version-2.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/d/d2/Become-Root-in-Ubuntu-Step-10- Version-2.jpg/v4-728px-Become-Root-in-Ubuntu-Step-10-Version-2.jpg”,”smallWidth”:460,”smallHeight”:346,”bigWidth”:728,”bigHeight” :547,”licensing”:”<div class=”mw-parser-output”></div>”}
    Type su - in and then press ↵ Enter . Enter the root password when prompted in the root prompt.

    • To disable the super user account, enter the command sudo passwd -dl root . [7] X Research Sources
  • Advice

    • You should minimize logging in as a super user. You can execute most commands that require root privileges with sudo or gksudo .
    • You can also use sudo –i to access other users’ shells on the system. For example, to become “tao”, you would type sudo –I tay and enter YOUR password (not that of “tao”) when prompted.
    X

    This article is co-authored by a team of editors and trained researchers who confirm the accuracy and completeness of the article.

    The wikiHow Content Management team carefully monitors the work of editors to ensure that every article is up to a high standard of quality.

    This article has been viewed 53,003 times.

    To perform administrator tasks on Linux, you must have root access (superuser or superuser). Having a separate root account is common on most Linux distros, but Ubuntu disables superuser permissions by default. This is to prevent you from accidentally making errors and keep your system safe from suspicious intruders. To execute a command that requires root access, use sudo .

    READ More:   How to Get More Likes on TikTok

    Thank you for reading this post How to Get Root on Ubuntu at Tnhelearning.edu.vn You can comment, see more related articles below and hope to help you with interesting information.

    Related Search:

    Related Posts

    How to Create Curved Text in Photoshop
    How to fall asleep faster
    How to Install FBReader to Read eBooks

    Category: How To

    Previous Post: « Top 999+ Ronda Rousey Wallpaper Full HD, 4K✅Free to Use
    Next Post: Top 999+ Emilia Clarke Wallpaper Full HD, 4K✅Free to Use »

    Copyright © 2025 · Tnhelearning.edu.vn - Useful Knowledge