Lesson 13:linux Getting Help
- Almost all commands can use-h or--help to get help information
- The man command is Linux for detailed help information, the man document is divided into many types:
- Man–k documents that contain keywords
- Info is similar to man, and the information provided is updated to be detailed and displayed in a web-like format
- Both man and info can be searched using the/+ keyword method
- Many programs, commands are also very detailed documentation, such as txt,html,pdf in the/usr/share/doc directory, these documents are the most detailed documentation of the corresponding program
Lesson 14:linux user Base
- When you log in to Linux, you must be logged in as a user, a process needs to run as a user, and the user restricts the control of the resource to the consumer or process.
- Each user belongs to a primary group, and the group named as the group name of the user is the primary group, and can belong to the 0-N satellite group
- Each group has a groupid
- Each user who can log on has a specified shell
- The user ID is 32 bits, starting from 0, the old user ID is limited to below 6w, the user is divided into three types: root (the user with id 0 is the root user), System User (1-499); normal User (500 or above).
- The files in the system have a group that belongs to the user level. Use the ID command to display the currently logged in user information
- The passwd command can modify the current user password.
- Related files:/etc/passwd save user information;/etc/shadow Save user password (encrypted);/etc/group Save Group Information
- View logged on User: whoami-Displays the current user, who-shows which users have logged on to the system, W shows which users are logged in, and what is being done
- Useradd User name creation user. -D Home Directory,-s login shell;-u userid;-g Primary Group,-G subordinate group (up to 31), multiple use, delimited. It can also be implemented directly by modifying/etc/passwd, but is not recommended. -
- /etc/skel the newly created user will copy all the files in this directory to the new user's home directory, which is actually the user template.
- Modify user information: Usermod parameter username–l: New user name;-u: New user id;-l lock user;-U unlock
- Delete User: Userdel username delete user, userdel–r username Delete user and delete home directory
- Groupadd name Create Group, Groupdel name Delete Group,-G modify Group Id;-n group name
Class 15:linux Authority mechanism
- Linux has three permissions per file: R W x, the directory must have X permissions, or its contents cannot be viewed
- Linux permissions are controlled based on the UGO Model: U stands for user; G represents Group;o on behalf of other
- Chown user name, modify the owner of the file to which it belongs;-R recursively the owner of all files under the modified directory
- CHGRP groupname name, modify the group to which the file belongs;-R recursively group of all files under the modified directory
- chmod mode file, modify the permissions of the file. U,g,o represents users, groups, and others, a-ugo,+-represents the addition or deletion of the corresponding permission; rwx represents three permissions. Example: chmod u+rw name;chmod g-x name;chmod go+r name;chmod a-x Name
- To modify permissions digitally: R=4,w=2,x=1. Example: chmod 660 name;cmode 775 Name
?
Lesson 16: Default Permissions and Special permissions
- Each terminal has a Umask property, specifying the default permissions for new files, folders, umask using digital permissions, such as: 022
- The default permissions for the directory are: 777-umask; The default permissions for files are: 666-umask. In general, the default umask for normal users is the default umask for 002,root users is 022
- Command umask view umask value; umask value, setting umask value
- Special permissions: Suid,sgid,sticky. Suid, executed as the user of the file, not the user who executed the file; Sgid, as the file belongs to the group, the attribute group of any new file created in the directory is the same as the owning group of that directory; sticky, a user with write permission to a directory can only delete files that it owns. You cannot delete files owned by other users.
Linux Introductory Learning (vi)