Linux User Create delete and file permissions view changes

Source: Internet
Author: User

One

1. View the user

The command is as follows: WhoAmI

2. Create a user

Create user command: sudo adduser hello

Super User is Root

Delete user name command: sudo deluser hello--remove-home

Switch User login command: su-l Hello

3. User groups

Groups

View user groups command: Cat/etc/group

Or: Cat/etc/group | Sort (so that the displayed data is in dictionary order)

Create User group: Usermod

Ii. Permissions for Linux files

1. Permissions View

View Permissions command: Ls-l

View all file Permissions command: Ls-al

Linux all the text!!!!

Notice of file permissions:

The content shown in the analysis is as follows:

D stands for file rwx, which represents read, write, and Execute permissions, where "-" indicates that there is no such permission

Drwxrwxr-x: The first three rwx represents the root permission, the middle three rwx represents the permissions of the other user, and the last three represents the permissions of the members in the group.

Permissions can be changed, with the following command:

chmod g+w Hello

This command means adding the Write permission to the Hello file for the group member's permissions!!

2. Owner of the change file

The code is as follows:

Eg:sudo chown Hi document; CP Document/home/hi

The command analysis is as follows: The hi here represents a non-root user, and the file to be changed is document.

3. File Permissions Supplement

In addition to using chmod g+w hello in this way, we can also use the following way chmod 777 Hello this way

7 represents the RWX permission, where R is the value of 4,w is the value of 2,x is 1, their values are 2 squared, 2 of the first and 2 of the 0 parties.

The "G" represents the group

"O" means other.

"U" represents the user

Linux User Create delete and file permissions view changes

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.