LinuxQuestions.org
Visit Jeremy's Blog.
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-08-2012, 08:28 PM   #1
9199
LQ Newbie
 
Registered: Aug 2012
Posts: 3

Rep: Reputation: 0
Unhappy folder Permission


I have shared folder name nfs_share.

permission is

drwxrwxrwx it mean everyone have read,write,execute permission on this folder.

Now, how can i set the permission on this folder for user joye that he can execute/get access in this folder, but he can't create any file/folder and also can't read the child/sub folder/file.
 
Old 08-09-2012, 12:12 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,307

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
If you mean what I think
Code:
drwxr-x---   owner groupx
where joye is not owner but is in groupx

You'll need chown http://linux.die.net/man/1/chown & chmod http://linux.die.net/man/1/chmod
See also http://rute.2038bug.com/index.html.gz
 
Old 08-09-2012, 01:17 AM   #3
9199
LQ Newbie
 
Registered: Aug 2012
Posts: 3

Original Poster
Rep: Reputation: 0
With the chwon and chmod whatever the permission we set to a directory it will inherited to child directory.

chwon sets the ownership
chmod change the directory

but my question was to give the user joye access on /nfs_share but he can't read/write there he can only execute that folder.

i don have to implement the acl ruls here too.

I face this question in an interview?
 
Old 08-09-2012, 04:40 AM   #4
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Rep: Reputation: 26
Not sure whether I understood your Q correctly!

'joey' belongs to same group as you? And you are the user?
In that case dont give 'write' permission to the group..750 should be fine..you (user) will have all the permission, joey (group) will only have read and execute permission, and the rest dont have any access permission.

Hope it helps.
 
Old 08-09-2012, 04:48 AM   #5
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Rep: Reputation: 59
Code:
getfacl dir_or_file
and

Code:
setfacl dir_or_file

are what you are looking for, where the first one gives you the current ACLs and the second one modifies the ACLs.
 
Old 08-09-2012, 05:02 AM   #6
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Rep: Reputation: 59
ACL

Go through these commands I have mentioned above and this should help you:

Create a directory and assign full permissions to everyone:
Code:
[root@localhost ~]# mkdir /work ; chmod 777 /work
[root@localhost ~]# ls -ld /work/
drwxrwxrwx. 2 root root 4096 Aug  9 15:25 /work/
Log-in as an ordinary user and create a file in the directory created above:

Code:
[root@localhost ~]# su - demo
[demo@localhost ~]$ touch /work/hello-demo
[demo@localhost ~]$ ls -l /work/hello-demo 
-rw-rw-r--. 1 demo demo 0 Aug  9 15:26 /work/hello-demo
[demo@localhost ~]$ logout
Now disallow the above user only from creating anything in the /work directory:

Code:
[root@localhost ~]# getfacl /work/
getfacl: Removing leading '/' from absolute path names
# file: work/
# owner: root
# group: root
user::rwx
group::rwx
other::rwx

[root@localhost ~]# setfacl -m user:demo:-w /work/
[root@localhost ~]# getfacl /work/
getfacl: Removing leading '/' from absolute path names
# file: work/
# owner: root
# group: root
user::rwx
user:demo:-w-
group::rwx
mask::rwx
other::rwx
Now let's see demo can create anything in /work:

Code:
[root@localhost ~]# su - demo
[demo@localhost ~]$ touch /work/hello-demo
touch: cannot touch `/work/hello-demo': Permission denied
[demo@localhost ~]$ ls -l /home
total 19
drwx------. 30 demo      demo       3072 Aug  9 14:19 demo
drwx------.  4 Devarishi Devarishi  1024 Jun  4 13:30 Devarishi
drwx------.  2 root      root      12288 May 31 10:20 lost+found
[demo@localhost ~]$ logout

How about the others?

Code:
[root@localhost ~]# su - Devarishi
[Devarishi@localhost ~]$ touch /work/hello-Dev
Sounds good to you?
 
1 members found this post helpful.
Old 08-09-2012, 10:09 AM   #7
9199
LQ Newbie
 
Registered: Aug 2012
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks all
 
  


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
nfs server - sharing folder - folder permission dlugasx Linux - Server 1 02-15-2011 12:30 AM
Folder and file permission zion_rulz Linux - Newbie 5 07-09-2009 03:02 PM
Folder/File Permission??? ajeetraina Linux - Newbie 3 05-30-2008 03:25 AM
Permission to write to folder Garoth Linux - Software 1 10-09-2004 11:41 PM
Folder permission javamdk Slackware 9 07-07-2004 11:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:10 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
Open Source Consulting | Domain Registration