Current location - Trademark Inquiry Complete Network - Trademark registration - Linux file permission settings Linux file permission settings
Linux file permission settings Linux file permission settings
How to modify the permissions of linux users?

You can use the chmod command to change user rights and user groups in linux.

Add permissions to the current user chmod+wxfilename.

Chmod-R777/ upload

User group chgrp-Rfoldnamezdz

Chown-R owner user name. Group name folder name

For example: chown-Rzdz.nginxKooBox

Syntax: chmod file name

The meaning of each option in the command is

U stands for "user", that is, the owner of a file or directory.

G stands for "group users", that is, all users with the same group ID as the file owner.

O stands for "other users".

A stands for "all users". This is the system default.

Operation symbols can be:

+Add permissions.

-Revoke the permit.

= Grant the given permission and cancel all other permissions (if any).

Permission represented by the setting mode can be any combination of the following letters:

R readable.

W is writable.

X executable file.

Attach the x attribute only if the target file is executable for some users or if the target file is a directory.

S sets the owner or group ID of the process to the owner of the file when executing the file. Mode "U+S" sets the user ID bit of the file, and "G+S" sets the group ID bit.

T save the program text to the switching device.

U has the same permissions as the file owner.

G users in the same group as the file owner have the same permissions.

O Have the same permissions as other users.

example

Method for modifying file reading and writing attributes

For example, modify the index.html file to be writable, readable and executable:

chmod777index.html

To modify the properties of all files in the directory, write, read and execute:

chmod777*。 *

Just replace the folder name and suffix with *.

For example, modify the properties of all htm files:

chmod777*。 Suffix of html file

Method of modifying folder properties

Modify the directory /images/small to be writable, readable and executable.

Chmod 777/ Image/Miniature

How does linux grant permissions?

Create user useraddaa.

The root user sets the password passwd aa for AA and enters the password twice.

Set permissions: chown-Rredis:redis/aa.

Switch users su-aa.

Extended data:

Linux user authority 1, give root authority usermod-groottest2, and create user useradd_d/usr/test-mtest. This command creates a user test, and the user's home directory is /usr/test3. Set the user password to modify their own password passwd, and the super user needs to enter the old password to modify other users' passwords: (passwdtest4, chgrp command function:

How to set up user file rights management in kalilinux?

User file rights management can be set by the command chmod.

What is the specific command to modify file permissions in linux system?

Chmodu, g, o+/-/= r, w, xobject u (user), g (group), o (other)+means increase-decrease = the corresponding value u+r means that the owner adds an r (read) right, and g+w means that the owner adds a w (write) right. O+x means that other users can add an execution right. You can also use the digital method rwxrwxrwxugo421421421. Each permission bit adds up to 7. For example, chmod777a changed the file A to RWRWXRWX, and chmod644a changed the permission of A to RW-R-R-.

How to set the default permissions of linux?

When creating files and directories in linux, the permissions of directories created by a single user are the same, and so are the permissions of files created. The permissions that control this creation are called permission masks.

The function of privilege mask is to standardize the privilege settings when creating files and directories, and to avoid the problem of modifying privileges again after creation.

1. View user's privilege mask.

Command: umask

Directory: The maximum permission is 777, minus the last three digits of umask (022), and the directory permission created by this user is 755 by default.

File: The permissions of the file must be uniform. If it is odd, it needs-1 to become even. 777-022=755, and every bit-1 becomes an even number, which is 644.

2. Modify the user rights mask

Command: umask***

* * * can be 1-3 digits and the value of each digit must be =7.