2015/8/25 jobs: Related commands for users and groups

Source: Internet
Author: User

Related commands for users and groups

Useradd, Usermod, passwd, Userdel

Groupadd, Groupmod, GPASSWD, Groupdel

Chage, Chsh, CHFN

ID, W, who, WhoAmI

Su


------------------------------------


19. Permissions
Permissions: R, W, X
File:
R: Readable, can view file contents with commands like Cat
W: writable, can edit or delete this file
X: Executable, can be executed at the command prompt as a command to submit to the kernel.
Directory:
R: You can perform LS on this directory to list all internal files
W: You can create files in this directory
X: You can use the CD to switch to this directory, or you can use Ls-l to view the details of the internal files.
===========================================================================================
20, Useradd
Useradd NAME: Add user
-U UID: Specifies the primary ID of the user
-G GID: Specifies the base group ID or group name (this group must first exist to be used)
-G GID: Set additional groups (additional groups), you can specify multiple, separated from each other by commas (this additional
Group must first exist to be used)
-C "COMMENT" specifies annotation information
-d/path/to/somedirectory Specify the user's home directory, when not used by default in the home
Create a directory with the same name as the user.
-s Specifies the shell, and the path is finally the shell path specified in the Etc/shells file.
-M does not create home directories for users
-R creates a system user, a common system call, and does not establish a home directory
Userdel USERNAME: Deleting users
(The user's home directory is not deleted by default when no parameters are added)
-R: Delete the user and also delete the home directory
===========================================================================================
21. Id
ID command: View the ID information for the current user
-G USERNAME: View the user's GID
-U USERNAME: View uid of user
-G USERNAME: View all groups of users
-un: Displays the user name of the current user
-GN: Displays the group name of the current user
===========================================================================================

22, Finger
Finger command: View user account information
Finger USERNAME
===========================================================================================

24. User Account Attribute Management
Usermod: Modifying the properties of an account
usermod [option] USERNAME
-U: Modify UID
-G: Modify GID
-G: Modify additional groups
-A-G: Add additional groups without overwriting previous additional groups
-C: Modify user's comment information
-D: Know the new home directory for users
-d-m: Specify the home directory and move files from the previous home directory to the new home directory
-S: Modify the user's default shell
-L: Modify user Name
-L: Lock user account
-U: Unlock Account
==========================================================================================

25. User Password Management
passwd USERNAME
-L: Lock account
-U: Unlock Account
-D: Remove user password
-N: Minimum user password time
-x: Maximum User password usage time
PWCK: Checking user account Integrity
==========================================================================================

26. Group Management
Groupadd: New Group
groupadd [option] GROUPNAME
-g:gid specifying GID
-R: Added as System group
Groupmod: Group Properties
groupmod [option] GROUPNAME
-G GID: modifying GID
-N Name: Modify Group name
GPASSWD: Modify Group password
GPASSWD GROUPNAME
===========================================================================================


27, Chage
Chage: Change user account information
-D: Last modification time
-E: Expiration time
-I: Inactive time
-M: Minimum period
-M: Maximum age
-W: Warning time
===========================================================================================


28, Chown
Chown: Change the file owner, belong to the group, only the administrator is also this command
Chown USERNAME file .... (Change the directory itself only)
-R Recursive modification (owner of modified directory and its internal files)
--reference=/path/to/somefile file ... Set the owner of the file to the
Somefile the same as the owner (no need to designate the owner)
Chown username:grpname Fiel ... Change both the owner and the group
Chown username,grpname Fiel ... Change both the owner and the group
Chown:groupname Fiel .... Modify Genus Group
===========================================================================================


29, Chgrp
CHGRP: Modifying a file group
Chgrp GROUPNAME file .... (Change the directory itself only)
-R recursive modification (modifying the genus Group of directories and their internal files)
--reference=/path/to/somefile file ... Set the owner of the file to the
The genus of somefile (not required to designate a group)
===========================================================================================

30, chmod
chmod: Modify the file's user rights
chmod MODE File ...
-R: Recursive modification
--reference=/path/to/somefile file ...
chmod 755 File ...
Modify certain permissions for a certain type of user
U: Owner
G: Genus Group
O: Other
A: All
chmod user category =mode Fiel.
chmod U=wr,g=w/fiel.
chmod uo=wr/file.
Modify a certain bit or some bit permission for a user of a class
chmod user Category [-/+]mode fiel:

2015/8/25 jobs: Related commands for users and groups

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.