Set file permissions in Ubuntu

Source: Internet
Author: User

When hadoop is configured today, hadoop-‐env. Sh cannot be modified, even if the following command is used:

Sudo gedit hadoop-env.sh

It cannot be modified. Later I thought it might be because I set the hadoop file directory permission. Its command:

Sudo chown-r hadoop: hadoop hadoop-0.20.1/<br/>

Therefore, run the following command to View File Permissions:

Ls-all

View the hadoop-env.sh file to the permission and the result is as follows:

-RW-r -- 1 hadoop 2245 hadoop-env.sh <br/>

 

The first "-" indicates that this is a file, followed by 9 Characters"RW-r --"
It is the permission information, a group of three letters, the three letters are respectively rwx,-indicates that this permission is not available, the first groupRW-
Indicates the owner's permissions. The second groupRW-
Permissions of users in the same workgroup group as the owner, and permissions of users in the third workgroupR --
Permissions of users who are not in the same working group as the owner, followed by connections, and two hadoop instances are in the Working Group of the owner and owner respectively.

We can see that the permission of hadoop as the owner is RW-, and the read-write permission cannot be executed; the permission of other users in the hadoop Working Group is RW-, and the read-write permission cannot be executed; the permission of other working group users is r --, read-only.

 

That's why xuwei users are not in the hadoop group, because the administrator user xuwei cannot modify the hadoop-env.sh file. Run the following command to switch to a hadoop User.

 

Su hadoop

Switched to the hadoop user.

Sudo gedit hadoop-env.sh

However, the error "hadoop is not in the sudoers file" is returned.

For solutions, see the previous blog

Ubuntu tips: "XXX is not in the sudoers file" SOLUTION

After the preceding problem is solved successfully, run the following command:

Sudo chmod + x hadoop-env.sh

In this way, you can edit and modify the file.

Solve this problem.

 

 

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.