Two ways to modify folder permissions under ubuntu

One, this method is very simple, the key is that you have to find this file in your home folder.

Select the folder, right click ------> properties (properties)

----------> permissions (permissions).

You can see the permission settings of the owner (owner) group user (group) other users (others), you can modify the permissions here.

 

Second, the command method

 

1. First, let's talk about how to view permissions:

ls -l + filename (folder change -l to -ld)

example:

zhouchang@zhouchang-CW65S:~$ ls -ld me

drwxrwxrwx 3 zhouchang zhouchang 4096 December 6 15:39 me

In fact, drwxrwxrwx should be divided into this: d rwx rwx rwx

 r is readable, w is writable, x is executable, and d is the file attribute.

 

2, Common modification commands:

sudo chmod 600 ××× (only the owner has read and write permissions)

sudo chmod 644 ××× (owner has read and write permissions, group users only have read permissions)

sudo chmod 700 ××× (only the owner has read and write and execute permissions)

sudo chmod 666 ××× (everyone has read and write permissions)

sudo chmod 777 ××× (everyone has read and write and execute permissions)

 

Each digit of the three digits represents a permission setting for a user type.

From front to back are: the owner (owner), group users (group), other users (others).

The value is 0~7, that is, [000]~[111] in binary.

0 [000] No permissions

4 [100] Read only access

6 [110] Read and write permissions

7 [111] Read write execute permission

Three, command plus manual

1. Enter the command in the terminal: sudo nautilus + path

For example: sudo  nautilus /etc

It will automatically open the folder under etc. At this time, you can right-click - Properties - Permissions.

If you directly right-click - Properties - Permissions can not be modified,

因为文件的所有者是root。

但是你打入sudo nautilus +路径后是一root的身份打开的文件夹,所有者会变成me。

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326880034&siteId=291194637