Linux User and file Rights management

Source: Internet
Author: User

W.H.O.

-A print all that can be printed
-D Print dead process
-M with AM I,mom likes
-Q Print The current number of logged in users and user name
-U print current logged in user login information
-R print Run level

su,su-and Sudo

su <user>You can switch to users user, you need to enter the password of the target user, sudo <cmd> you can run the cmd command at the privilege level, you need the current user to be a sudo group, and you need to enter the current user's password. The su - <user> command also switches the user, and the environment variable is changed to the target user's environment variable.

New User/user group

sudo useradd Jason New user

Groups Jason or Cat/etc/group see which group the user belongs to

sudo usermod-g sudo Jason adds Jason user to sudo group

sudo deluser jason--remove-home Delete user

sudo chown Jason Iphone6 modify file Owner

CP Iphone6/home/jason copy files to Jason home directory

chmod iphone6 or chmod go-rw iphone6 Modify user rights

Useradd only create the user, created with passwd Lilei to set the new user's password. AddUser will create a user, create a directory, create a password (prompting you to set up), do this series of operations. In fact, Useradd, userdel such operations more like a command, after the execution of the return. And adduser more like a program, you need to enter, determine a series of operations.

Linux User and file Rights management

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.