Ubuntu, user, folder, user group understanding

Source: Internet
Author: User
Tags file permissions

Linux, each file, folder has its own: the user, the user group belong to

The authority is also divided into three paragraphs

Ls-l can be viewed, rwx respectively: Read and write execution

For example: Ls-l get KKK directory: rwr-xr--x KKK KKK

This means that the KKK directory is allowed for the file owner KKK to be read and write, and is not writable for the user group KKK the file belongs to

Can only be performed for other users, not read or write


Now there are guest users, to the KKK directory, is not able to modify the file, if you need to modify


1. Set the KKK directory recursively to another permission of 7 namely: RWX, but this is an unsafe procedure

Chmod-c-R 777 KKK

Change KKK directory, recursion, all files, folder to 777 that is: rwxrwxrwx


2. Change the owner of the KKK to the guest user

sudo chown-r guest/home/kkk

This represents the change Owner-r (recursive) guest (target user)/home/kkk (the path to owner needs to be changed)

So the KKK owner becomes a guest,su to the guest user, logs in to the KKK directory, and can write to the


Similarly, using CHGRP can change the group that the file belongs to

Change Group

With these settings, the user, the user group, the corresponding file permissions can be understood



With common instructions:

1. Groupadd MySQL

2. Mkdir/home/mysql

3. useradd-g mysql-d/home/mysql MySQL

4. Copy mysql-5.0.45-linux-i686-icc-glibc23.tar.gz to/usr/local directory

5. Decompression: Tar zxvf mysql-5.0.45-linux-i686-icc-glibc23.tar.gz

6. Ln-s mysql-5.0.45-linux-i686-icc-glibc23 MySQL

7. Cd/usr/local/mysql

8. chown-r MySQL.

9. chgrp-r MySQL.



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.