Common commands for Ubuntu permission management

Source: Internet
Author: User
Common commands for Ubuntu permission management 1. chmod method 1 chomd [{ugoa} {+-=}{ rwx}] [file or directory] u stands for the user g of the file to represent the user group o of the file to represent guest all users +-= indicate adding permissions respectively, reduce permissions or grant permissions to all users with write permissions on t2.tmp files. Method 2: chmod [mode = 421] [file or folder] 4 indicates read permissions.

Common commands for Ubuntu permission management

1.chmod

Method 1

Chomd [{ugoa} {+-=}{ rwx}] [file or directory]

U indicates the user to which the file belongs.
G indicates the user group to which the file belongs.
O represents a visitor
A Represents all users

+-= Add permissions, reduce permissions, or grant permissions respectively

Grant all users the write permission to the t2.tmp file:

Method 2:

Chmod [mode = 421] [file or folder]

4 indicates read permission
2 indicates write permission
1 indicates the execution permission

For example, if the user of a file has all permissions, the group has read and execution permissions, and others have execution permissions, you can set the permission as follows:

Rwx:

2. chown [target user] [file or folder]

Change the owner of a file or directory

Change the t2.tmp file owner to lenve

3. chgrp [user group] [files or directories]

Change the group of a file or directory

4. umask [-S] specifies the default permission mask when a file is created. -S indicates the permission mask in rwx format.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2 This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-08/121395.htm

 

 

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.