• 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 Full Privileges (Root) in Linux

December 17, 2023 by admin Category: How To

You are viewing the article How to Get Full Privileges (Root) in Linux  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 55,016 times.

The “root” account on a Linux computer is an account with full permissions. To manipulate commands on Linux, especially those that affect system files, often we need root or privileged access. With great power, unlike normal user rights, root access should be requested only when necessary. As a result, important system files can be protected from unwanted damage.

Table of Contents

  • Steps
    • Gain root access with terminal
    • Unlock root account (Ubuntu)
    • Log in with full control
    • Reset root password and admin password
  • Warning

Steps

Gain root access with terminal

Image titled Become Root in Linux Step 1

Image titled Become Root in Linux Step 1

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/f/f1/Become-Root-in-Linux-Step-1-Version-3.jpg/v4-728px-Become-Root- in-Linux-Step-1-Version-3.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/f/f1/Become-Root-in-Linux-Step-1- Version-3.jpg/v4-728px-Become-Root-in-Linux-Step-1-Version-3.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
Open the terminal command line window interface program. If the terminal is not already on, open it. Many Linux versions allow opening the terminal by pressing Ctrl + Alt + T .
Image titled Become Root in Linux Step 2

Image titled Become Root in Linux Step 2

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/4/44/Become-Root-in-Linux-Step-2-Version-3.jpg/v4-728px-Become-Root- in-Linux-Step-2-Version-3.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/4/44/Become-Root-in-Linux-Step-2- Version-3.jpg/v4-728px-Become-Root-in-Linux-Step-2-Version-3.jpg”,”smallWidth”:460,”smallHeight”:344,”bigWidth”:728,”bigHeight” :545,”licensing”:”<div class=”mw-parser-output”></div>”}
Type . su - and press ↵ Enter . You will be logged in as an “advanced user”. You can actually use this command to log on to the computer as a regular user. However, when left blank, it will let you log in with privileges. [1] X Research Source
Image titled Become Root in Linux Step 3

Image titled Become Root in Linux Step 3

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/4/44/Become-Root-in-Linux-Step-3-Version-3.jpg/v4-728px-Become-Root- in-Linux-Step-3-Version-3.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/4/44/Become-Root-in-Linux-Step-3- Version-3.jpg/v4-728px-Become-Root-in-Linux-Step-3-Version-3.jpg”,”smallWidth”:460,”smallHeight”:344,”bigWidth”:728,”bigHeight” :545,”licensing”:”<div class=”mw-parser-output”></div>”}
Enter the preferred account password when prompted. After typing su - and pressing ↵ Enter , you will be asked to type the password for your preferred access account.

  • If you receive an “authentication error” message, your root account is most likely locked. Read the next section to learn how to unlock it.
Image titled Become Root in Linux Step 4

Image titled Become Root in Linux Step 4

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/6/68/Become-Root-in-Linux-Step-4-Version-3.jpg/v4-728px-Become-Root- in-Linux-Step-4-Version-3.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/6/68/Become-Root-in-Linux-Step-4- Version-3.jpg/v4-728px-Become-Root-in-Linux-Step-4-Version-3.jpg”,”smallWidth”:460,”smallHeight”:346,”bigWidth”:728,”bigHeight” :547,”licensing”:”<div class=”mw-parser-output”></div>”}
Check out the command line interpreter. When logged in with privileges, the command line interpreter will end up with # instead of $ . [2] X Research Source
Image titled Become Root in Linux Step 5

Image titled Become Root in Linux Step 5

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/4/44/Become-Root-in-Linux-Step-5.jpg/v4-728px-Become-Root-in-Linux- Step-5.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/4/44/Become-Root-in-Linux-Step-5.jpg/v4-728px-Become- Root-in-Linux-Step-5.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Enter a command that requires priority access. Once you’ve used su - to log in with privileges, you can run any command that requires privileged access. The su command persists until the session ends, so you don’t need to re-enter the privilege password every time you need to run the command.
Image titled Become Root in Linux Step 6

READ More:   How to Find Motivation to Study

Image titled Become Root in Linux Step 6

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/4/48/Become-Root-in-Linux-Step-6.jpg/v4-728px-Become-Root-in-Linux- Step-6.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/4/48/Become-Root-in-Linux-Step-6.jpg/v4-728px-Become- Root-in-Linux-Step-6.jpg”,”smallWidth”:460,”smallHeight”:347,”bigWidth”:728,”bigHeight”:549,”licensing”:”<div class=”mw-parser -output”></div>”}
Consider using . sudo instead of su - . sudo (“super user do”) is a command that allows you to run other commands with temporary privileges. This is the best way to run a command that requires root access for most users, because at this point you don’t need a privileged access environment and the user doesn’t need to know the account password. Users will enter their usual login password to get temporary root access. [3] X Research Sources

  • Type sudo command and press ↵ Enter (such as sudo ifconfig ). When prompted, type your user password, do not type the preferred account password.
  • sudo is the preferred method with versions like Ubuntu: it works even when the root account is locked.
  • This command is only for users with administrative rights. Users can be added or removed from /etc/sudoers .

Unlock root account (Ubuntu)

Image titled Become Root in Linux Step 7

Image titled Become Root in Linux Step 7

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/3/38/Become-Root-in-Linux-Step-7.jpg/v4-728px-Become-Root-in-Linux- Step-7.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/3/38/Become-Root-in-Linux-Step-7.jpg/v4-728px-Become- Root-in-Linux-Step-7.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Unlock the root account (Ubuntu). Ubuntu (and some other versions) locks the root account to prevent normal users from accessing it. This is because when using the sudo command (see above), we rarely need privileged access. Unlocking the root account will allow you to log in with full privileges.
Image titled Become Root in Linux Step 8

Image titled Become Root in Linux Step 8

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/b/be/Become-Root-in-Linux-Step-8.jpg/v4-728px-Become-Root-in-Linux- Step-8.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/b/be/Become-Root-in-Linux-Step-8.jpg/v4-728px-Become- Root-in-Linux-Step-8.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Open terminal. If you are working on the desktop environment, you can press Ctrl + Alt + T to run the terminal.
Image titled Become Root in Linux Step 9

Image titled Become Root in Linux Step 9

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/6/6a/Become-Root-in-Linux-Step-9.jpg/v4-728px-Become-Root-in-Linux- Step-9.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/6/6a/Become-Root-in-Linux-Step-9.jpg/v4-728px-Become- Root-in-Linux-Step-9.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Type . sudo passwd root and press ↵ Enter . When prompted, enter your user password.
Image titled Become Root in Linux Step 10

Image titled Become Root in Linux Step 10

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/9/96/Become-Root-in-Linux-Step-10.jpg/v4-728px-Become-Root-in-Linux- Step-10.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/9/96/Become-Root-in-Linux-Step-10.jpg/v4-728px-Become- Root-in-Linux-Step-10.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Set a new password. You will be asked to create and enter a new password twice. Once it’s set, the root account will be active. [4] X Research Sources
Image titled Become Root in Linux Step 11

Image titled Become Root in Linux Step 11

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/8/8f/Become-Root-in-Linux-Step-11.jpg/v4-728px-Become-Root-in-Linux- Step-11.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/8/8f/Become-Root-in-Linux-Step-11.jpg/v4-728px-Become- Root-in-Linux-Step-11.jpg”,”smallWidth”:460,”smallHeight”:346,”bigWidth”:728,”bigHeight”:547,”licensing”:”<div class=”mw-parser -output”></div>”}
Lock the root account again. If you want to lock the root account, enter the following command to remove the password and lock the account:

  • sudo passwd -dl root

Log in with full control

Image titled Become Root in Linux Step 12

Image titled Become Root in Linux Step 12

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/7/77/Become-Root-in-Linux-Step-12.jpg/v4-728px-Become-Root-in-Linux- Step-12.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/7/77/Become-Root-in-Linux-Step-12.jpg/v4-728px-Become- Root-in-Linux-Step-12.jpg”,”smallWidth”:460,”smallHeight”:347,”bigWidth”:728,”bigHeight”:549,”licensing”:”<div class=”mw-parser -output”></div>”}
Consider using other methods to get temporary root access. Logging in with full control should be restricted to normal use because in doing so it is easy to execute commands that could render the system inoperable. At the same time, it also poses a security risk, especially when an SSH server is being run on the computer. Only sign in with full access when urgent repairs are needed, such as disk failure resolution or locked account recovery.

  • Using sudo or su instead of logging in with full access helps prevent unwanted damage during login. These commands give the user the opportunity to consider the command before serious harm is incurred.
  • Some versions, such as Ubuntu, lock the root account until you open it yourself. This not only prevents users from accidentally doing too much harm using the root account, but also protects the system from hackers: the root account is often their first target. When locked, hackers will not be able to gain access with the root account. You can refer to the instructions on unlocking the root account on Ubuntu in the previous section.
READ More:   How to Tie Shoelaces
Image titled Become Root in Linux Step 13

Image titled Become Root in Linux Step 13

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/b/b3/Become-Root-in-Linux-Step-13.jpg/v4-728px-Become-Root-in-Linux- Step-13.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/b/b3/Become-Root-in-Linux-Step-13.jpg/v4-728px-Become- Root-in-Linux-Step-13.jpg”,”smallWidth”:460,”smallHeight”:347,”bigWidth”:728,”bigHeight”:549,”licensing”:”<div class=”mw-parser -output”></div>”}
Enter . root in the user field when logging into Linux. If the root account is not locked and if you know the password, you can log in with root access when asked for the usual login. Enter root in the user field when asked to log in.

  • If you need root access to execute a certain command, use the method above.
Image titled Become Root in Linux Step 14

Image titled Become Root in Linux Step 14

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/c/c7/Become-Root-in-Linux-Step-14.jpg/v4-728px-Become-Root-in-Linux- Step-14.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/c/c7/Become-Root-in-Linux-Step-14.jpg/v4-728px-Become- Root-in-Linux-Step-14.jpg”,”smallWidth”:460,”smallHeight”:344,”bigWidth”:728,”bigHeight”:545,”licensing”:”<div class=”mw-parser -output”></div>”}
Enter the root password in the user password field. After entering root in the username field, enter the root password when prompted.

  • In many cases, the root password can just be “password”.
  • If you don’t know or forget your root password, see instructions for resetting the password below.
  • In Ubuntu, the root account is locked and unusable until opened.
Image titled Become Root in Linux Step 15

Image titled Become Root in Linux Step 15

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/f/f4/Become-Root-in-Linux-Step-15.jpg/v4-728px-Become-Root-in-Linux- Step-15.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/f/f4/Become-Root-in-Linux-Step-15.jpg/v4-728px-Become- Root-in-Linux-Step-15.jpg”,”smallWidth”:460,”smallHeight”:344,”bigWidth”:728,”bigHeight”:545,”licensing”:”<div class=”mw-parser -output”></div>”}
Avoid running complicated programs while logged in as root. It is possible that by gaining root access, the program you intend to run will negatively affect the system. Instead of logging in as root, sudo and su are recommended to run the program.

Reset root password and admin password

Image titled Become Root in Linux Step 16

Image titled Become Root in Linux Step 16

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/e/eb/Become-Root-in-Linux-Step-16.jpg/v4-728px-Become-Root-in-Linux- Step-16.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/e/eb/Become-Root-in-Linux-Step-16.jpg/v4-728px-Become- Root-in-Linux-Step-16.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Reset root account password when forgotten. If you forget your root account password and user password, you will need to start your computer in recovery mode to change these passwords. If you know the user password and need to change the root account password, just type sudo passwd root , enter the user password and create a new root password.
Image titled Become Root in Linux Step 17

Image titled Become Root in Linux Step 17

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/0/0d/Become-Root-in-Linux-Step-17.jpg/v4-728px-Become-Root-in-Linux- Step-17.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/0/0d/Become-Root-in-Linux-Step-17.jpg/v4-728px-Become- Root-in-Linux-Step-17.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Restart the computer and hold down the- . ⇧ Shift left when the BIOS screen appears. The GRUB menu will be opened.

  • Pressing and holding the key at the right time is quite difficult, so you may have to try many times.
READ More:   How to Use Conditioner for Hair
Image titled Become Root in Linux Step 18

Image titled Become Root in Linux Step 18

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/b/bc/Become-Root-in-Linux-Step-18.jpg/v4-728px-Become-Root-in-Linux- Step-18.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/b/bc/Become-Root-in-Linux-Step-18.jpg/v4-728px-Become- Root-in-Linux-Step-18.jpg”,”smallWidth”:460,”smallHeight”:344,”bigWidth”:728,”bigHeight”:545,”licensing”:”<div class=”mw-parser -output”></div>”}
Select item . (recovery mode) – recovery mode – first in the list. Recovery mode for your current operating system version will be downloaded.
Image titled Become Root in Linux Step 19

Image titled Become Root in Linux Step 19

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/9/91/Become-Root-in-Linux-Step-19.jpg/v4-728px-Become-Root-in-Linux- Step-19.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/9/91/Become-Root-in-Linux-Step-19.jpg/v4-728px-Become- Root-in-Linux-Step-19.jpg”,”smallWidth”:460,”smallHeight”:344,”bigWidth”:728,”bigHeight”:544,”licensing”:”<div class=”mw-parser -output”></div>”}
Select option . root from the menu that appears. The command line window interface in which you are logged in as root, will be started.
Image titled Become Root in Linux Step 20

Image titled Become Root in Linux Step 20

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/b/b5/Become-Root-in-Linux-Step-20.jpg/v4-728px-Become-Root-in-Linux- Step-20.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/b/b5/Become-Root-in-Linux-Step-20.jpg/v4-728px-Become- Root-in-Linux-Step-20.jpg”,”smallWidth”:460,”smallHeight”:346,”bigWidth”:728,”bigHeight”:548,”licensing”:”<div class=”mw-parser -output”></div>”}
Connect the drive with write permissions. When booting in recovery mode, you usually only have read permissions. Enter the following command to enable write access:

  • mount -rw -o remount /
Image titled Become Root in Linux Step 21

Image titled Become Root in Linux Step 21

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/b/bd/Become-Root-in-Linux-Step-21.jpg/v4-728px-Become-Root-in-Linux- Step-21.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/b/bd/Become-Root-in-Linux-Step-21.jpg/v4-728px-Become- Root-in-Linux-Step-21.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Create a new password for any locked accounts. When you log in as root and change your permissions, you can create a new password for every account:

  • Type passwd accountName and press ↵ Enter . If you want to change the root account password, type passwd root .
  • Enter the new password twice when prompted.
  • Image titled Become Root in Linux Step 22

    Image titled Become Root in Linux Step 22

    {“smallUrl”:”https://www.wikihow.com/images_en/thumb/5/55/Become-Root-in-Linux-Step-22.jpg/v4-728px-Become-Root-in-Linux- Step-22.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/5/55/Become-Root-in-Linux-Step-22.jpg/v4-728px-Become- Root-in-Linux-Step-22.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
    Restart the computer after resetting the password. Once you’ve reset your password, you can restart your computer as usual. The new password will take effect immediately. [5] X Research Sources
  • Warning

    • Use the root account only when necessary and exit as soon as you’re done.
    • Only share the root account password with people A) trust, and B) need to know.
    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 55,016 times.

    The “root” account on a Linux computer is an account with full permissions. To manipulate commands on Linux, especially those that affect system files, we usually need root or privileged access. With great power, unlike normal usage rights, root access should be requested only when necessary. As a result, important system files can be protected from unwanted damage.

    Thank you for reading this post How to Get Full Privileges (Root) in Linux 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+ art hanuman images – Amazing Collection art hanuman images Full 4K
    Next Post: Top 999+ full hd wallpaper mahakal images – Amazing Collection full hd wallpaper mahakal images Full 4K »

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