Home Operation and Maintenance Linux Operation and Maintenance How to switch between root and ordinary users in ubuntu

How to switch between root and ordinary users in ubuntu

Aug 07, 2017 pm 01:47 PM
root ubuntu

The following editor will bring you an article on how to switch between root and ordinary users in ubuntu (recommended). The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor and take a look.

After logging in to ubuntu, the default is ordinary user permissions. So how to switch between ordinary user permissions and root permissions? Here is a summary of how to switch between them.

Switch from ordinary user to root user

After logging in to ubuntu, press the key combination CTRL+ALT+T to enter the terminal interface, the general terminal interface The default is the ordinary user permission mode. How to enter the root user from an ordinary user, there are the following methods:

1. Press su, and then enter the corresponding root password as prompted to log in with root permissions.

2. Press sudo su, and then enter the corresponding root password as prompted to log in with root authority (under this command, you generally do not need to enter the corresponding root password).

3. Press su root, and then enter the corresponding root password as prompted to log in with root permissions.

There are three ways to switch the root user to a normal user:

1. If you want to switch back to the user user from the root user, just execute the command: su user (user is your user name during installation),

2. Enter exit directly,

3. Ctrl+D key combination to exit

How to set a password for the root user: Just execute the command: sudo passwd root and follow the prompts step by step.

Disable and enable root login

Execute sudo passwd -l root (just disable root, but the root password is still saved), then execute su root and find that the authentication failed, (but sudo su command can still enter root mode).

To start root login again, execute sudo passwd -u root.

The above is the detailed content of How to switch between root and ordinary users in ubuntu. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What should I do if the Ubuntu terminal cannot be opened? How to fix the problem that Ubuntu cannot open the terminal What should I do if the Ubuntu terminal cannot be opened? How to fix the problem that Ubuntu cannot open the terminal Feb 29, 2024 pm 05:30 PM

What should I do if the Ubuntu terminal cannot be opened? How to fix the problem that Ubuntu cannot open the terminal

How to cancel the lock icon in the lower right corner of the Ubuntu 18.04 folder? How to cancel the lock icon in the lower right corner of the Ubuntu 18.04 folder? Jan 12, 2024 pm 11:18 PM

How to cancel the lock icon in the lower right corner of the Ubuntu 18.04 folder?

Log in to Ubuntu as superuser Log in to Ubuntu as superuser Mar 20, 2024 am 10:55 AM

Log in to Ubuntu as superuser

A sneak peek of the seven highlights of Ubuntu 24.04 LTS A sneak peek of the seven highlights of Ubuntu 24.04 LTS Feb 27, 2024 am 11:22 AM

A sneak peek of the seven highlights of Ubuntu 24.04 LTS

Ubuntu 20.04 screen recording software OBS installation and uninstallation graphic tutorial Ubuntu 20.04 screen recording software OBS installation and uninstallation graphic tutorial Feb 29, 2024 pm 04:01 PM

Ubuntu 20.04 screen recording software OBS installation and uninstallation graphic tutorial

How to remove icons in Ubuntu start menu? How to remove icons in Ubuntu start menu? Jan 13, 2024 am 10:45 AM

How to remove icons in Ubuntu start menu?

Ubuntu finally supports disabling automatic updates of snap packages Ubuntu finally supports disabling automatic updates of snap packages Jan 13, 2024 am 10:09 AM

Ubuntu finally supports disabling automatic updates of snap packages

How to install Angular on Ubuntu 24.04 How to install Angular on Ubuntu 24.04 Mar 23, 2024 pm 12:20 PM

How to install Angular on Ubuntu 24.04

See all articles