LinuxQuestions.org
Review your favorite Linux distribution.
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-11-2016, 02:21 PM   #1
vRanger
LQ Newbie
 
Registered: May 2014
Posts: 9

Rep: Reputation: Disabled
Folder permissions help requsted


Searching endlessly and not grasping onto a solution. Thanks for your help!

I have a folder that has "drw------- 1 admin admin"
I want "user" to be able to "ls"
I chmod the folder to this "drw----r-x 1 admin admin"
Now "user" can "ls"
So can everyone else.
I only want "user" to be able to see the contents of "folder".
I don't what to change "admin admin" of folder.

How?
 
Old 08-11-2016, 02:26 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,124
Blog Entries: 10

Rep: Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815
Put "user" in the "admin" group. Chmod to be 750 to attain drw-r-x---

Take note of who else is in the "admin" group.

Since "admin" is more general purpose, then consider using an alternate group for ownership of this directory, or adjust the user's in the "admin" group, but cautiously. I don't normally mess with the "admin" group and instead if I have a sub-directory where I wish to control the access per user, I would chown and chgrp to have it be unique versus a system typical choice
 
Old 08-11-2016, 03:32 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,400

Rep: Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486
You can also use ACLs for a more fine-grained control:
Code:
setfacl -m u:someuser:rx /path/to/folder
 
3 members found this post helpful.
Old 08-11-2016, 08:14 PM   #4
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,205

Rep: Reputation: 197Reputation: 197
Permission is:

Owner - Group - Others or everyone else

Quote:
"drw----r-x 1 admin admin"

d=directory
Owner=rw- (read and write)
Group=--- (no rights)
Others or the World = r - x (read and execute but no write)
Or try changing the Umask for that folder to 277.

Last edited by JJJCR; 08-11-2016 at 08:23 PM. Reason: edit
 
Old 08-11-2016, 09:31 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,152
Blog Entries: 14

Rep: Reputation: 3080Reputation: 3080Reputation: 3080Reputation: 3080Reputation: 3080Reputation: 3080Reputation: 3080Reputation: 3080Reputation: 3080Reputation: 3080Reputation: 3080
This article gives a good intro to Linux permissions: https://www.linux.com/learn/understa...le-permissions

Note that, as far as Linux is concerned, everything is a file, so the article also applies to directories, even though it says "file" in the title.

Last edited by frankbell; 08-11-2016 at 09:33 PM.
 
2 members found this post helpful.
Old 08-12-2016, 12:35 AM   #6
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,627

Rep: Reputation: 471Reputation: 471Reputation: 471Reputation: 471Reputation: 471
Well coached from the master helpers. Problem is solved if OP follows the hints above.

I only wanted to clarify on something from the OP what means he/she in saying:
Quote:
I only want "user" to be able to see the contents of "folder".
I don't what to change "admin admin" of folder.
How?
Do you mean the "user" group... or a particular login $USERNAME ?

If you mean the "user" group then you may need to juggle up properties of two existing groups which may not be favorable.

But if you mean "user" as particular login $USER then the solution is simple:

Code:
sudo usermod -a -G admin $USERNAME

--
for example: sudo usermod -a -G admin vRanger
that particular user login name as "vRanger" becomes now a true scout ranger who should be able to do what the "owner" of the folder/file can.

Hope that helps. Good luck and enjoy.

m.m.
 
1 members found this post helpful.
  


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
Copy a Folder to Another Folder and Retain its Permissions voshika Linux - Newbie 2 04-26-2016 08:24 AM
Changing folder permissions and its sub folder and files? stratotak Linux - Newbie 6 12-29-2011 05:11 AM
[SOLVED] Folder Permissions cducker Linux - Newbie 6 08-13-2010 12:14 AM
permissions difference between /home/..../folder and /root/folder darkleaf Linux - General 3 07-21-2005 05:23 PM
Folder permissions fatboyjim Linux - Newbie 12 06-05-2002 02:20 PM


All times are GMT -5. The time now is 10:13 PM.

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