LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 09: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, 01:12 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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, 02: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, 05: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, 05:48 AM   #5
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 576

Rep: Reputation: 48
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, 06:02 AM   #6
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 576

Rep: Reputation: 48
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, 11: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 01:30 AM
Folder and file permission zion_rulz Linux - Newbie 5 07-09-2009 04:02 PM
Folder/File Permission??? ajeetraina Linux - Newbie 3 05-30-2008 04:25 AM
Permission to write to folder Garoth Linux - Software 1 10-10-2004 12:41 AM
Folder permission javamdk Slackware 9 07-07-2004 12:26 PM


All times are GMT -5. The time now is 06:35 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