LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   pwd: error retrieving current directory: getcwd: cannot access parent directories: Pe (https://www.linuxquestions.org/questions/linux-general-1/pwd-error-retrieving-current-directory-getcwd-cannot-access-parent-directories-pe-639698/)

bootkernel 05-03-2008 08:32 PM

pwd: error retrieving current directory: getcwd: cannot access parent directories: Pe
 
On my os (building from scratch)
in /root dir a common user run
$pwd
pwd: error retrieving current directory: getcwd: cannot access parent directories: Permission denied

Code:

lynn@Linux-vserver:/root$ ls -ld /root
drwx------ 2 root root 4096 Apr 29 15:05 /root
lynn@Avct Linux-vserver:/root$

I know that a common user doesn't have access to /root dir
but in some populate distribution,it don't give above message

Code:

lynn@ Linux-vserver:/root$ bash --version
GNU bash, version 3.2.25(1)-release (i686-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
lynn@Avct Linux-vserver:/root$


pwd commmand comes from shell


thanks for your help


Lynn

introuble 05-05-2008 05:45 AM

I'm not sure I'm getting this. Are you saying a regular user who's current directory is "/root" is getting that error when issuing `pwd`? How is the user getting inside /root in the first place?

"Some popular distributions" don't set /root's permissions to 700 (as on your box) by default but rather 755 or such.


All times are GMT -5. The time now is 11:26 PM.