Accounts and Groups
1. Create Accounts and Groups
Useradd Create an account
-C Set Account description information
-D Set Account home directory
-e Set Account expiration date
-G Set the basic group of Accounts
-G set up an additional group of accounts
-M does not create home directories and is typically used in conjunction with-s
-S Set the login shell default to bash
Useradd-s/sbin/nologin
-U Specify account UID
2.groupadd creating groups
-G Set ID number
3.id
Describe account and group information
Modify accounts and Groups
1.password
+ User Change Password
Change account authentication Information
-L lock account, only root is available for this option
-U Unlock Account
-D Quick Erase password
2.usermod
Modify account information
-D Modify Account home directory
-e Modify Account expiration date
-G Modify the base group to which the user belongs
-G Modify the additional group to which the user belongs
-S Modify account login Shell
-U Modify account UID
3. Delete accounts and groups
Userdel
Delete accounts and related files
-R All Delete home directory
Groupdel
Delete a group account
Account information saved in/etc/password
Account password information saved in/etc/shadow
Group account information is saved in/etc/group
Group account password information is saved in/etc/gshadow
File and Directory Permissions
1.R W x
Viewing permissions with Ls-l
---------
Owner Group Other accounts
2. Modifying document properties
chmod
Eg:chmod 777 File name
chmod u=,g=,o= file name
chmod u:,g:,o: File name
ACL access Rights control
1.setfacl
eg:setfacl-m u::---file name
This article from "Big Plum" blog, declined reprint!
Linux Review basics of account and security