Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-14-2012, 12:37 AM   #1
LQ Newbie
Registered: Jun 2012
Posts: 14

Rep: Reputation: Disabled
Change the permission of the folder or file for a specific user

Hello evreyone

I have a folder or a specific file name Suppose text

P asked me to give permissions to this file for user in sys Suppose I have named jhon

And allow him to read and write rw

P What is it required that the bearing!

If you want to change my terms of reference for the total or the owner of the file or the other about it the next

chmod g rw text

I hope it's origin had to add the powers of a given system's Yoezer

Greetings to you
Old 08-14-2012, 01:34 AM   #2
Registered: Oct 2009
Location: Leander, TX
Distribution: Fedora 20
Posts: 97

Rep: Reputation: 35
I think your asking how to change users of a specific file or directory as opposed to permissions.
Just in case, changing permissions for an owner is done like this:
chmod u+rw fileName
Changing the actual owner might look something more like this:
chown john fileName
Finally, if you need to change the owner and group, use the following
chown john:groupName fileName
Old 08-14-2012, 01:47 AM   #3
LQ Newbie
Registered: Jun 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
thx bro

but if

drwxr-xr-x. 2 root admins 4096 Aug 14 08:08

if jhon member of admins , and i don't want he read or write to file

thx again
Old 08-14-2012, 02:38 AM   #4
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
A) Then why is jhon a member of admins? Or why was admins chosen as the file's group? Use a different group.

B) Use file ACLs. Create an file acl for the text file for user jhon and deny access. In Linux if a user is denied access explicitly then group or other permissions won't increase access.

For example a file text.txt owned by jhon, and the file's group is admins. If the files permissions are 044, then jhon won't have access even though other members of admins do. In this example, jhon will be able to change permissions of the file since he is the owner. This is why I suggested using acls instead.

You will need to verify this yourself. I'm on a tablet away from my computer.

Also note that this behavior is Linux specific, opting for most restrictive. Another difference is that Linux doesn't allow suid scripts. Or rather that Linux ignores the suid bit for scripts.

Last edited by jschiwal; 08-14-2012 at 02:42 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] File permission to specific user ! noony123 Linux - Newbie 3 01-13-2011 08:11 AM
CLI How to change folder access permission for particular user sfkong Linux - Newbie 10 07-20-2008 01:34 PM
Change owner, group and permission settings on file and folder creation?? helptonewbie Linux - Newbie 9 12-17-2007 04:03 PM
user specific file access permission synna Linux - Security 3 01-14-2004 12:53 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:06 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration