Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to enable root users in Ubuntu

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces how to enable root users in Ubuntu, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Sudo permission

Sudo allows an authorized user to run the program as another user (usually the root user). If you want to grant sudo access to another user, simply add that user to the sudo group:

Bob@ubuntu-18-04VOUR $sudo usermod-aG sudo username

The way to use sudo is to add the sudo command before the command:

Bob@ubuntu-18-04VOUR $sudo tail-1 / etc/passwd

The first time you use sudo in a session, you are prompted to enter the current user's password. If you want to use sudo password-free, you need to edit the / etc/sudoers file. You can run the following command to edit this configuration file:

Bob@ubuntu-18-04VO4VOUR $sudo visudo

Find the line% sudo ALL= (ALL:ALL) ALL, add NOPASSWD: at the specified location, and then save exit, and you can avoid using sudo with the password.

% sudo ALL= (ALL:ALL) NOPASSWD: ALL

Open root user account

An ordinary user needs to have sudo permission first, and then execute sudo passwd root to set the password for the root user:

Bob@ubuntu-18-04virtual sudo passwd rootEnter new UNIX password: Retype new UNIX password: passwd: password updated successfully

In this way, you can log in to the system with root users.

Turn off root users

When you no longer need to log in with a root account, you can set the password of the root user to expire and turn off the password of the root user:

Bob@ubuntu-18-04 rootpasswd $sudo passwd-l: password expiry information changed.

After setting the root password to expire, use the su command to switch to the root user and find that the prompt authentication failed:

Bob@ubuntu-18-04 rootPassword rootPassword $su: su: Authentication failure

On how to enable root in Ubuntu users to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report