Linux command-New user

Source: Internet
Author: User

#useradd  -g whh -d /software/whh whh Create user whh, join WHH Group, home directory under/SOFTWARE/WHH # useradd  -s /sbin/nologin -m wxh Create a user who cannot log on to the system and has no home directory wxh# useradd -g adm -d  /home/twsdsadm/ adm  Create user ADM, belong to ADM Group, home directory/home/adm/# usermod -u 34085 adm    Change uid# groupmod -g 5010 mercury    Change gid# usermod -ag  stage,port adm   appends the user ADM to the Stage,port group, separated by commas between multiple groups # gpasswd -a test test2   Add user test to the Test2 group # gpasswd -d test test2  Remove the user test from the Test2 group # usermod -g   Group name   user   (group must exist)   Modify user's basic group modify test user's home directory $ usermod -md /home/usertest  user name   $ usermod -d /usr/newfolder -u uid  -u must be followed by the UID, not username instance analysis # groupadd -g 5010 test;useradd -g test -u 5010 -d /home/ Test test# echo  "123456"  | passwd --stdin test;usermod -a -g othergroup test;id  test New group test and specify GID, new user test join group test, home directory/home/test, password 123456, and then add the user to the Othergroup group.

File permissions

The normal file defaults to 644, which is:

-rw-r--r--1 root root 0 May15 20:04 test

Self-read/write (rw), the same group of people have read (R), others have read (R)

Default permissions can be modified by umask

The default umask is 022

File: 666-022 = 644

Table of Contents: 777-022 = 755

If you have umask 011, the resulting file directory permissions will become:

File: 666-011 = 655

Table of Contents: 777-011 = 766


Linux command-New 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.