Sponsored Content
Top Forums UNIX for Advanced & Expert Users EACCES "Permission denied" while open(2) Post 302421534 by ulidtko on Friday 14th of May 2010 03:37:03 PM
Old 05-14-2010
EACCES "Permission denied" while open(2)

Code:
guest@ulidtko:~$ id
uid=126(guest) gid=134(guest) groups=134(guest)

guest@ulidtko:~$ ls -ld /home
drwxr-xr-x 8 root root 4096 May 12 19:47 /home

guest@ulidtko:~$ ls -l /home
ls: cannot open directory /home: Permission denied

guest@ulidtko:~$ cat /proc/mounts 
rootfs / rootfs rw 0 0
none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
none /proc proc rw,nosuid,nodev,noexec,relatime 0 0
none /dev devtmpfs rw,relatime,size=1022396k,nr_inodes=216381,mode=755 0 0
none /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
/dev/disk/by-uuid/ab0d6ed0-ecbc-4718-be12-cbb3955c1aaf / ext3 rw,relatime,errors=remount-ro,data=ordered 0 0
none /sys/fs/fuse/connections fusectl rw,relatime 0 0
none /sys/kernel/debug debugfs rw,relatime 0 0
none /sys/kernel/security securityfs rw,relatime 0 0
none /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
none /var/run tmpfs rw,nosuid,relatime,mode=755 0 0
none /var/lock tmpfs rw,nosuid,nodev,noexec,relatime 0 0
none /lib/init/rw tmpfs rw,nosuid,relatime,mode=755 0 0
/dev/sda1 /boot ext2 rw,relatime,errors=continue 0 0
/dev/sda6 /home/max ext3 rw,relatime,errors=continue,data=ordered 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
gvfs-fuse-daemon /home/max/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=1001,group_id=1001 0 0
none /tmp/guest-home.cRIW3S tmpfs rw,relatime,mode=700 0 0
gvfs-fuse-daemon /tmp/guest-home.cRIW3S/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=126,group_id=134 0 0

guest@ulidtko:~$ strace ls -l /home 2>&1 | grep /home -C 6
read(3, "nodev\tsysfs\nnodev\trootfs\nnodev\tb"..., 1024) = 346
read(3, "", 1024)                       = 0
close(3)                                = 0
munmap(0xb7711000, 4096)                = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfef7fd8) = -1 EINVAL (Invalid argument)
ioctl(1, TIOCGWINSZ, 0xbfef8130)        = -1 EINVAL (Invalid argument)
lstat64("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lgetxattr("/home", "security.selinux", 0x9c7b268, 255) = -1 ENODATA (No data available)
getxattr("/home", "system.posix_acl_access", 0x0, 0) = -1 EOPNOTSUPP (Operation not supported)
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
--
_llseek(3, 0, [0], SEEK_CUR)            = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=1382, ...}) = 0
mmap2(NULL, 1382, PROT_READ, MAP_SHARED, 3, 0) = 0xb7711000
_llseek(3, 1382, [1382], SEEK_SET)      = 0
munmap(0xb7711000, 1382)                = 0
close(3)                                = 0
open("/home", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission denied)
write(2, "ls: ", 4ls: )                     = 4
write(2, "cannot open directory /home", 27cannot open directory /home) = 27
write(2, ": Permission denied", 19: Permission denied)     = 19
write(2, "\n", 1
)                       = 1
close(1)                                = 0
close(2)                                = 0
exit_group(2)                           = ?

Can anybody explain, why could i be getting this error?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

screen throws "permission denied"

Hi all, i've got problem in running a script in background... i have written a script, and i want to run it everytime i log in, but when i log off i want the script to stay (i watch not to run two scripts at one time in the script). so as a normal user i want to do: $ screen my_script & ... (6 Replies)
Discussion started by: miechu
6 Replies

2. UNIX for Advanced & Expert Users

permission denied for ". " (dot space)

Hi, When I try to run a script with ". "(dot space) in my home, it gives me error ".: Permission denied". Any explanation for this behaviour? Thanks in advance, -Ashish (3 Replies)
Discussion started by: shriashishpatil
3 Replies

3. UNIX for Dummies Questions & Answers

changing password with sudo user " permission denied"

HI All, I am using solaris i created a user adam and updated his permissions in vi sudoers file as follows adam ALL=(ALL) NOPASSWORD: ALL ........... when i create user by logging as sudo user . $ sudo useradd -d /home/kalyan -m -s /bin/sh kalyan sudo: not found ... (6 Replies)
Discussion started by: kalyankalyan
6 Replies

4. OS X (Apple)

"Permission Denied" while modifying mounted files on MAC

Hi, I have two machines 1. MacOSx (Users --> userMac , IP - a.b.c.d) 2. FreeBSD (Users --> userBSD, IP- p.q.r.s) I want to modify some files of FreeBSD on my MacOS. So, I mounted the FreeBSD folder on my Mac as follows. $ sudo mount -o -P p.q.r.s:/usr/home/user... (5 Replies)
Discussion started by: akash.mahakode
5 Replies

5. Solaris

BSM auditing issues, need to audit "permission denied"

Let me preface with I am semi-new to Solaris. I work with it in the labs at work and that's about my extent (although I run Linux at home). Well, a week ago security comes around with updated requirements, some of which are the need to audit all failures. For the life of me I cannot get a... (0 Replies)
Discussion started by: mph275
0 Replies

6. Red Hat

+ + in .rhosts is causing a "Permission Denied"

I have a user who has "+ +" at the top of his .rhosts file. He cannot "rsh NODE date" to a different box ( both are RHEL 5.4 ). If I remove the "+ +" then the "RSH" works. I have correct settings of node names/user in the .rhosts file. I even tried adding to the second box's... (3 Replies)
Discussion started by: rom828
3 Replies

7. Linux

Showing "permission denied" when trying to login in - Montavista Linux

Hello friends, I have scratched my system and after that when I am trying to access the console via root login it's failing with an error message of "permission denied". I am able to access the other login, I am having only problem with root and some other user login. I am using an telnet... (2 Replies)
Discussion started by: sanoop
2 Replies

8. UNIX for Advanced & Expert Users

Showing "permission denied" when trying to login in - Montavista Linux

Hello friends, I have scratched my system and after that when I am trying to access the console via root login it's failing with an error message of "permission denied". I am able to access the other login, I am having only problem with root and some other user login. I am using an telnet... (7 Replies)
Discussion started by: sanoop
7 Replies

9. Solaris

"Permission denied" when changing IP netmask

hello everyone, I am new on unix systems. I am working with a Solaris 10 OS. When i try to change netmask on certain interface: I get: How can i enable permission for changing that ? I have administrator privileges. Your help is much appreciated. thanks, (13 Replies)
Discussion started by: pablod76
13 Replies

10. OS X (Apple)

"Permission denied" when trying to SSH my iPhone though password is correct

Hi, I hope this is the correct section in the forum to post as I'm trying to SSH from my MacBook. I was looking to see whether ssh on my jailbroken iPhone 6s (10.3.1) still works fine and was following this old reddit guide. I installed OpenSSH&OpenSSL from Cydia and changed the password using... (7 Replies)
Discussion started by: hss1
7 Replies
All times are GMT -4. The time now is 08:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy