Ubuntu Add Admin user

Source: Internet
Author: User

Ubuntu default only the installation of the account is the system administrator account, will not give root user rights.

under the Administrator account, using the passwd command to root a password, you can use root .

however, when using useradd, If you do not add a parameter, you are adding a regular account. How to add a new system administrator account


#USERADD-MR * * *(the name of the account you want to add) then

# PADDWD * * * ( newly added account name )

whereuseradd 's parameter description can be viewed using useradd--help .

-M creates the account home directory, which is not created by default.

-R to create a system administrator account



Another parameter -S was not understood at the time, only to be found when problems arose.

When you create a user this way, when you switch to that user, you find thatthe ll command doesn't work, and the environment doesn't seem to be the default bash.

Yes,ubuntu Create new user The default environment is not bash, pit.

specific ubuntu The default value for creating new users can be viewed using the useradd-d command.

Home=/home

Inactive=-1

Expire=

Shell=/bin/sh

Skel=/etc/skel

Create_mail_spool=no

sure enough, the default is sh instead of the default bash like bird Brother with CentOS.

to use bash as the default shell environment, you will need the following:

# useradd-s/BIN/BASH-MR * * *

modifies the default shell environment.

there is another way to change the shell Environment, which is to modify the/etc/passwd file.

The end of your new account is your default shell environment.

However, it is best to create an account when it was modified, after all, modify the file error-prone.


I add an account here using root, however, the system administrator can also add the system administrator account, do not need to use root

usage:$sudo useradd-s/BIN/BASH-MR * * * can. After all , you can use root without rootand reduce risk.


Ubuntu Add Admin user

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.