LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-14-2012, 12:37 AM   #1
it-secret
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
roger_heslop
Member
 
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:
Code:
chmod u+rw fileName
Changing the actual owner might look something more like this:
Code:
chown john fileName
Finally, if you need to change the owner and group, use the following
Code:
chown john:groupName fileName
 
Old 08-14-2012, 01:47 AM   #3
it-secret
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
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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.
 
  


Reply


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


All times are GMT -5. The time now is 02:39 AM.

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