subdirectories or files under the Directory, add the-R parameter directly. Let's take a look at the syntax and examples:
[Root @ linux ~] # Chown [-R] account name file or directory [root @ linux ~] # Chown [-R] account name: User group name file or directory parameter:-R: for recursive (recursive) continuous changes, that is, all files and directories under the
User and group management command useradd lt; user name gt;/create a user grep lt; user name gt; /etc/shadow/verify whether the user is successfully created (the last user created o
Add a System Administrator group to CentOS and perform related operations
1. User Creation:
Adduser phpq // create a phpq userPasswd phpq // set a password for the phpq user
2. Create a working groupGroupadd test // create a test workgroup
3. Create a user and
complete.[Email protected] test]# chmod 755 file1[Email protected] test]# ls-l file1-rwxr-xr-x 1 root root 5 November 23:33 file17) Change the permissions of the file File1 in digital form so that the owner can only read the file. No other user has permission. View the settings results.[Email protected] test]# chmod file1[Email protected] test]# ls-l file1-R--------1 root root 5 November 23:33 file18) go back to the upper directory to see the test pe
-Rw-r -- 1 root users 68495 Jun 25 install. log
[Root @ linux ~] # Chgrp testing install. log
Chgrp: invalid group name 'testing' Change the file owner, chown
So how to change the owner of a file? Very simple. Since the change user group is a change group, the change owner is the change owner ). This is the purpose of
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
the user;-C,--comment Comment: Modify the annotation information;-D,--home Home_dir: Modify the user's home directory, the user's original files will not be transferred to the new location;-M,--move-home: can only be used with the-D option to move the original home directory to a new home directory;-L,--login new_login: Modify user name;-S,--shell Shell: Modifies the user's default shell;-L,--lock: Lock th
the current user 3. Useradd # # # New user - u # # # Specify uid for user - G # # # Specify user initial group, this group must exist - G # # # Specifies additional groups, and groups also exist - C # #
Transfer from http://blog.csdn.net/todd911/article/details/16370577In UNIX systems, privileges are based on user and group IDs, and when programs need to add privileges or need access to resources that are not currently allowed, we need to replace our ownUser ID or group ID, so that the new ID has the appropriate privi
separated by commas) Common commands: view the information of the currently logged on user: id: view the information of a user: id user_name view the current user group: groups view all users in a group: cat/etc/gshadow | grep group_name or cat/etc/
user group information will be saved in the change file, the group corresponding user list, will also be saved inside. Similarly, each row represents the details of a group. Below, view the first 3 groups to see the relevant account information.[Email protected] ~]# head-3/
In UNIX systems,Privilege(For example, the expression of the current date and access control can be changed (for example, whether a specific file can be read or written ))Is based on the user ID and group ID. When the program needs to add privileges or access resources that are not currently allowed to access, we need to change our
file owner.
O indicates "Other (Others) Users ".
A Indicates "All (all) Users ". It is the default value of the system.
The operation symbol can be:
+ Add a permission.
-Cancel a permission.
= Grant the given permission and cancel all other permissions (if any ).
Set the permissions indicated by mode to any combination of the following letters:R readable.W writable.X executable.X adds the X attribute only when the target file is executable to some u
also use the passwd-l user name to lock the user. This operation also requires the root permission, as shown below:
After the user is locked, the user cannot log on successfully even if the user has entered the correct user name
1. Create a CentOSMysql user group [root @ localhost ~] # Grepmysqletcgroup # If the user group mysql exists in the query system, add the user group if no
their names to uppercase and save them to the/tmp/etc.conf file.ls/etc/|Grep-e ". conf$" | tr [A-z] [a-z] >/tmp/etc.conf7. Displays the total number of sub-directories or files in the/var directory.[Email protected] var]# Ls-l |grep "^[d|-" | Wc-l178. Remove the names of the 10 groups with the smallest number of the third field in the/etc/group file.[[email protected] var]# sort-n-T ":"-K 3/etc/group |Head
:/etc/group Group name: Password: GID: Additional group added/etc/gshadow Group name: password: Group administrator: Add-on group added to
Relationship of users and groups
used before this date, and the account will expire after expiration.9) as a reserved use, no meaning." New / delete users and user groups "A. Add a new group Groupadd [-G GID] GroupNameNo-G is created according to the system default GID group, like the user, GID is also sta
Objective:
In the user management, group management process, the most basic four files are/etc under the Passwd,shadow,group,gshadow. They record information related to users and groups. Is the basic of learning and in-depth understanding of users, groups.In addition to these basic configuration files, there are configuration files related to initialization.
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.