Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a user on my CentOS server who is not part of any group, just by themselves.

How can I give that user 777 permissions without affecting any other user on the server? I have chroot off, so I can see everything, but the user cannot write.

Do I use chown?

share|improve this question
4  
More details please, I don't understand the real issue here. –  slhck Aug 16 '11 at 21:42
1  
You can't give 777 permissions to a user. You can give it to a file, though. –  Wuffers Aug 17 '11 at 0:12
add comment

3 Answers 3

Depending on exactly what you mean, the easiest thing to do would be to create a group just for this user, but your question frankly isn't all that clear. Go into more detail.

share|improve this answer
add comment

The permissions on the file are how the operating system determines what access to grant to a given user. 0777 is an explicit statement that the owner, the group and everyone else will all have full read-write-execute privileges.

You're after POSIX ACLs, which can be read with getfacl and set with setfacl. These come in the acl RPM and require that the filesystem support ACLs. The normal Linux filesystems all support ACLs and, these days, should enable ACL support in the filesystem metadata.

The best check for whether ACL support is available is just to try to set an ACL on a file.

So:

$ sudo yum install acl
$ setfacl -m user:fred:rwx my_file

This will grant fred rwx (07) permissions on my_file without affecting anyone else.

Be careful to not tie yourself in knots with ACLs. They're powerful, but best used sparingly. It's normally better to create a new group.

share|improve this answer
add comment

I am assuming that you want to give the user root-like permissions so that he can read/write/execute everything, without giving the same to other users.

Edit your /etc/sudoers file (using the visudo command as root) and add the following line at the end

# Assuming the username is dummyUser who is about to get root-like permissions
dummyUser ALL=(ALL) ALL
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.