Linux_005 _ user, group, and permission basics

Source: Internet
Author: User
Linux_005 _ user, group and permission basics Linux_004 _ disk and file system http://www.2cto.com/os/201306/223130.html 1. users can be divided into three types:-root user (ID 0)-system user (1-499)-common user (more than 500) id display information of the current user pas... linux_005 _ user, group and permission basics Linux_004 _ disk and file system http://www.2cto.com/os/201306/223130.html 1. there are three types of users:-root user (ID 0)-system user (1-499)-common user (more than 500) id: displays the information of the current user. passwd: modifies the password of the current user. whoami: displays which users have logged on to the system. w: displays which users have logged on to the system. related files/etc/passwd save user information/etc/shadow save user password (encrypted) /etc/group Save group information 2. user management create user useradd nash_su this command will execute the following operations (1 ). add user information to/etc/passwd (2 ). if you use the passwd command to create a password, save it in/etc/shadow (3 ). create a new home directory/home/nash_su (4) for the user ). copy the files in/etc/skel to your home directory (5 ). create a group with the same user name, by default, the new user belongs to the same name group parameter-d home directory-s. log on to shell-u userId-g main group-G affiliated group (up to 31 sub-groups can be separated by commas) modify usermod parameter username-l username-u userid-d home directory-g main group-G affiliated group-L lock so that it cannot log on-U unlock delete user userdel nash_su keep home directory userdel-r nash_su delete home directory at the same time 3. group management groupadd linuxcast create group groupmod-n newname oldname modify group name groupmod-g newGid oldGid modify group idgroupdel linuxcast delete Group 4. permission management (1 ). permissions are generally divided into Read (r), write (w), and execute (x). each process runs as a user, so the process has the same permissions as the user, if the user has a large permission, the process has a large directory and must have x permissions; otherwise, the content cannot be viewed (2 ). UGO permission drwxr-xr -- 2 nash_su training 208 Oct 1 linuxcast.net file type U permission G permission O permission link quantity u g size time file name (3 ). change file permission chown nash_su linuxcast.net change file linuxcast.net user-R parameter recursively modify all files under directory User chgrp nash_su linuxcast.net change file linuxcast.net group-R parameter recursion modify the chmod mode file mode of the group to which all files under the Directory belong to u in the following format, g, o stands for users and groups respectively. other a can represent ugo +.-represents joining or deleting r, w, and x represents three permission examples: chmod u + rw linuxcast.net adds the read/write permission to the user of the linuxcast.net file. chmod g-x linuxcast.net removes the execution permission from the Group of the linuxcast.net file and digitally modifies the permission-r = 4-w = 2-x = 1 rw = 4 + 2 = 6rwx = 4 + 2 + 1 = 7r-x = 4 + 1 = 5 for example: chmod 660 linuxcast. ne
Related Article

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.