By default, only the account used during installation of Ubuntu is the system administrator account and does not grant root user permissions. Under the Administrator account, use the passwd command to give the root user a password and then use the root user. However, if you do not add a parameter when using useradd, you can add a common account. How to add a new system administrator account? What do I do when I use the root account: # useradd-mr *** (the name of the account you want to add) and # paddwd
By default, only the account used during installation of Ubuntu is the system administrator account and does not grant root user permissions.
Under the Administrator account, use the passwd command to give the root user a password and then use the root user.
However, if you do not add a parameter when using useradd, you can add a common account.
How do I add a new system administrator account? What do I do when I use the root account:
# Useradd-mr *** (name of the account you want to add)
Then
# Paddwd *** (new account name)
You can use useradd -- help to view the parameter description of useradd.
-M is the main directory of the account to be created. It is not created by default.
-R: Create a system administrator account
Another parameter-s was not clear at the time, and was discovered only when a problem occurred later.
When you use this method to create a user and switch to the user, you will find that the ll command is useless and the environment does not seem to be the default bash.
Yes. The default environment for creating new users in ubuntu is not bash.
You can use the useradd-D command to view the default values of new users created in ubuntu.
HOME =/home
INACTIVE =-1
EXPIRE =
SHELL =/bin/sh
SKEL =/etc/skel
CREATE_MAIL_SPOOL = no
Sure enough, the default is sh rather than CentOS's default bash.
To use bash as the default shell environment, you need:
# Useradd-s/bin/bash-mr ***
Modify the default shell environment.
Another way to change the shell environment is to modify the/etc/passwd file.
The last line of the account you created is your default shell environment.
However, it is recommended that you modify the file when creating an account. After all, file modification is prone to errors.
// ****** // Here, the root account is used to add the account. However, the system administrator can also add the system administrator account without using the root account.
// ***** // Usage: $ sudo useradd-s/bin/bash-mr. After all, root is not used without root to reduce risks.