A brief analysis of how to set the initial value of Linux root

A brief analysis of how to set the initial value of Linux root

Ubuntu does not allow root login by default, so the initial root account cannot be used. You need to use sudo permissions under a normal account to modify the root password.

Enter sudo passwd root in the terminal and press Enter. The system will then prompt you to enter the password of a normal user (the password entered in the terminal will not be displayed).

After entering, press Enter, and then enter the new root password twice to activate the root user.

First log in as a normal user and enter the following command>>>

~$ sudo passwd root
[sudo] passwd for you:****** (enter the user password, the password will not be displayed)
Enter new UNIX password:****** (set root password)
Retype new UNIX password: ****** (repeat password)

Then remind the success message.

Log in as root user >>>

~$ su root

passwd:***** (directly use the modified root password)

su switches to the root user by default and changes to the root user's environment. After entering, you can switch to the root user in the terminal to perform some operations.

Specific input process:

Summarize

The above is the method of setting the initial value of Linux root introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time!

You may also be interested in:
  • How to modify the root or other user password when you forget the password in the virtual machine Linux system
  • How to modify and reset the root password in Linux (super simple)
  • How to reset MySQL root password in Linux (CentOS)
  • How to set the initial root password in Linux
  • How to modify the root password of mysql under Linux
  • How to switch from a normal user to root without password in Linux
  • Solutions to forget mysql root password in Linux environment (three)

<<:  Detailed explanation of Vue Notepad example

>>:  Solution to MySQL garbled code problem under Linux

Recommend

Similar to HTML tags: strong and em, q, cite, blockquote

There are some tags in XHTML that have similar fu...

Example of how to install nginx to a specified directory

Due to company requirements, two nginx servers in...

MYSQL updatexml() function error injection analysis

First, understand the updatexml() function UPDATE...

Three ways to parse QR codes using javascript

Table of contents 1. Use JavaScript to parse the ...

Linux concurrent execution is simple, just do it this way

Concurrency Functions time for i in `grep server ...

Basic learning and experience sharing of MySQL transactions

A transaction is a logical group of operations. E...

Detailed explanation of the usage and function of MySQL cursor

[Usage and function of mysql cursor] example: The...

How to build YUM in Centos7 environment

1. Enter the configuration file of the yum source...

Toolkit: A more powerful front-end framework than Bootstrap

Note: Currently, the more popular front-end frame...

Solution to forgetting mysql database password

You may have set a MySQL password just now, but f...

How to reset MySQL root password

Table of contents 1. Forgot the root password and...