In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
This article gives you a detailed description of how to disable and enable root accounts in Ubuntu. For security reasons, the root account is disabled by default in Ubuntu Linux. I hope it will be helpful to all of you.
Sudo user
Ubuntu users can perform system administration tasks by granting administrative privileges to regular users using a tool called sudo. Sudo allows authorized user rights to run the program as another user (usually the root user).
By default, members of the sudo group are granted sudo access on Ubuntu systems. Because the initial user created by the Ubuntu installer is already a member of the sudo group, the logged-in Sudo user is likely to have been granted administrative privileges.
If you want to grant sudo access to other users, simply add the user to the sudo group:
Usermod-aG sudo username
To temporarily elevate root privileges, you need to run the command with the prefix sudo:
Sudo some-command
The first time you use sudo in a session, you are prompted for a user password.
If you want to run a command with sudo privileges without entering a password, you need to edit the sudoers file. To do this, type visudo:
Sudo visudo
This will open the / etc/sudoers file using our favorite command line text editor. To replace username with a custom user name, add the following line to the etc/sudoers file:
Username ALL= (ALL) NOPASSWD: ALL
Enable the Root account in Ubuntu
If you need to enable the root account for some reason, you only need to set the password for the root user. In Ubuntu and other Linux distributions, you can use this passwd command to set or change the password for a user account.
As an ordinary user of Ubuntu, you can only change your own password. We need to have sudo authority before setting the root password.
To enable the root account in Ubuntu, you need to run the following command:
Sudo passwd root
You will be prompted to enter and confirm the new root password:
Enter new UNIX password:Retype new UNIX password:passwd: password updated successfully
Description: when typing, the password is not displayed on the screen.
This successfully enables the root account in Ubuntu, and you can now log in to Ubuntu as root using the new password.
Note: when setting a password, be sure to use a strong, complex password. This is good for account security. A good password usually contains at least 16 characters, using at least one uppercase letter, one lowercase letter, one number, and one special character.
Disable the Root account in Ubuntu
If you previously enabled the root user in Ubuntu, to disable it now, simply set the root password to expire.
Use the following command:
Sudo passwd-l root
On how to disable and enable the root account in Ubuntu method to share here, I hope the above content can have a certain reference value for you, if you like this article, you might as well share it out 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.