Ubuntu Change folder owner and permissions

Source: Internet
Author: User

Today, installing Pyspider on Ubuntu16.04, encountering insufficient permissions, found that when installing Anaconda3, the owner of the folder is root. As a novice, only look for ways to change the owner of a folder, or to modify permissions for a folder.

There are two modifications in Ubuntu that can be used, "change Mode"&"change owner"

That is, chmod and chown, which can use the recursive parameter-r to change permissions for all child files and subdirectories.

1, the use of chmod Modify permissions:

Perform the same permissions changes for all sub-files in the document/directory as subdirectories:

chmod  document/

-r parameter is all files and subfolders under the recursive processing directory

700 is a changed permission representation (only the owner has permission to read and write and execute)

document/is the directory that needs to be executed

Common methods are as follows:

sudo chmod 600xxx (only the owner has read and write permissions)
sudo chmod 644xxx (owner has read and write permissions, group user only Read permissions)
sudo chmod 700xxx (only the owner has read and write and Execute permissions)
sudo chmod 666xxx (everyone has access to read and write)
sudo chmod 777xxx (everyone has access to read and write and execute)

where xxx refers to the file name (can also be a folder name, but to add-ld after chmod).

2. Use Chown to change the owner:

Perform the same owner change for all files in the document/directory as the subdirectory, modifying the username user who is the owner of the users user group

chown -R username:users document/

Username:users The Users user group username, user group parameters are not required. The following is also possible:

chown -R username:users document/

Ubuntu Change folder owner and permissions

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.