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 06-20-2016, 06:13 AM   #1
arun natarajan
Member
 
Registered: Jun 2014
Posts: 96

Rep: Reputation: Disabled
setfacl not working


hi,

1. even after setting the read permission for "/root/fb" file for "arun" user through acl, still he is not able to read the contents from it.

2. for the file "/root/fb" when using ls -l command, group permission shows as "rw". when viewing through getfacl command shows as only "r". May i know why there is a difference in it ?



[root@client1 ~]# uname -a
Linux client1.example.com 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

[root@client1 ~]# setfacl -m u:arun:rw /root/fb

[root@client1 ~]# ls -l /root/fb
-rw-rw-r--+ 1 root root 0 Jun 17 16:04 /root/fb

[root@client1 ~]# getfacl /root/fb
# file: root/fb
# owner: root
# group: root
user::rw-
user:arun:rw-
group::r--
mask::rw-
other::r--

[arun@client1 root]$ cat /root/fb
cat: /root/fb: Permission denied

 
Old 06-20-2016, 08:32 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,916

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
Quote:
Originally Posted by arun natarajan View Post
hi,

1. even after setting the read permission for "/root/fb" file for "arun" user through acl, still he is not able to read the contents from it.
2. for the file "/root/fb" when using ls -l command, group permission shows as "rw". when viewing through getfacl command shows as only "r". May i know why there is a difference in it ?
...and if you look at the permissions on the /root DIRECTORY, you don't have permission to enter it as your 'regular' user, do you?
 
Old 06-20-2016, 08:46 AM   #3
arun natarajan
Member
 
Registered: Jun 2014
Posts: 96

Original Poster
Rep: Reputation: Disabled
thanks for reply.

now i gave read permission for others, but no success

[root@client1 ~]# ls -ld /root/
dr-xr-x---. 31 root root 4096 Jun 17 16:29 /root/
[root@client1 ~]# chmod -R 554 /root
[root@client1 ~]# ls -ld /root/
dr-xr-xr--. 31 root root 4096 Jun 17 16:29 /root/
[root@client1 ~]# su arun
bash-4.1$
bash-4.1$
bash-4.1$ cat /root/fb
cat: /root/fb: Permission denied
bash-4.1$
 
Old 06-20-2016, 10:09 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,916

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
Quote:
Originally Posted by arun natarajan View Post
thanks for reply.

now i gave read permission for others, but no success

[root@client1 ~]# ls -ld /root/
dr-xr-x---. 31 root root 4096 Jun 17 16:29 /root/
[root@client1 ~]# chmod -R 554 /root
[root@client1 ~]# ls -ld /root/
dr-xr-xr--. 31 root root 4096 Jun 17 16:29 /root/
[root@client1 ~]# su arun
bash-4.1$
bash-4.1$
bash-4.1$ cat /root/fb
cat: /root/fb: Permission denied
bash-4.1$
Are you not reading what you're posting????? The directory is owned by ROOT, and the GROUP is root as well. You need to set the permissions on the root directory back to what they were, or you're going to have problems. Try doing this in a directory OTHER than /root.
 
Old 06-20-2016, 10:47 AM   #5
arun natarajan
Member
 
Registered: Jun 2014
Posts: 96

Original Poster
Rep: Reputation: Disabled
Thanks, it worked as expected after giving read and execute permission for others on /root.

Still i have a question, its was not working when i gave only read permission for others on /root. Hope, for listing the contents in a directory, read permission is enough.

[root@client1 ~]$ ls -ld /root/
drwxr-xr--. 31 root root 4096 Jun 20 19:25 /root/

[root@client1 ~]$ su - arun -c "ls -l /root/fb"
ls: cannot access /root/fb: Permission denied

[root@client1 ~]$ chmod 755 /root

[root@client1 ~]$ ls -ld /root/
drwxr-xr-x. 31 root root 4096 Jun 20 19:25 /root/

[root@client1 ~]$ su - arun -c "ls -l /root/fb"
-r-xr-xr--+ 1 root root 0 Jun 17 16:04 /root/fb
 
  


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
setfacl help avramovic Linux - Newbie 1 01-14-2015 10:43 AM
setfacl not working Bukhari1986 Red Hat 7 06-09-2012 07:15 AM
setfacl not working for me... how should I do it? Joan Murt Linux - Newbie 3 04-01-2012 05:47 AM
setfacl erat123 Linux - Security 2 05-31-2007 12:16 AM
setfacl linuxjamil Linux - Security 1 04-05-2007 03:00 PM


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