[SOLVED] Can't "cd/ls/etc" directory even as "root"
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've encountered a strange problem at work: I wanted
to remove some file under some directory but was unable
to "cd" into it, even after "su -".
Neither could I "ls" in this directory. Doing "\ls -la"
of it's parent directory gives permissions as:
Code:
[root@server_name users]# \ls -l
total 188
.
.
.
drwxrwxrwx 32 root bin 20480 Feb 28 07:24 user_back
[root@server_name users]# cd user_back
-bash: cd: user_back: Permission denied
[root@server_name users]# \ls -la user_back
ls: user_back: Permission denied
[root@server_name users]# chown -R root:root user_back
chown: changing ownership of `user_back': Operation not permitted
chown: cannot read directory `user_back': Permission denied
[root@server_name users]# uname -a
Linux server_name.site.local 2.6.9-78.ELsmp #1 SMP Wed Jul 9 15:46:26 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
[root@server_name users]# whoami
root
[root@server_name users]# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),556(beoper)
Interestingly, it's possible to view the contents of that directory
on widows through "Map network drive".
Originally the directory name was of the form: "user.back",
I managed to rename it but that's all, same access problems
remained. Before I renamed it it had been dated to 2010.
Since then we had more than a few total system shutdowns
I'm pretty sure no process is using this directory currently.
How is that directory mounted? If it's a remote filesystem mounted via NFS, be aware that root privileges do not propagate across NFS unless the filesystem has been exported with the "no_root_squash" option. Without that option, your "root" ID gets translated to "nfsnobody", and that ID lacks permission to access the directory.
First about the possibility that a Windows virus encrypting the volume:
the directory into which I can't cd is just one of the many existing in
its parent directory and all other directories are OK and any this one
directory shows this strange behavior. I don't think a virus would
be so picky.
As for NFS: yes, the access is through NFS (NAS, rather) so the
"irrelevance" of "root" permissions on the NFS server side might be
a plausible explanation. But what to do if that's the case?
And why only a single directory out of many which are OK?
I absolutely can't remove this directory because some important files might be there
I don't know if backup managed to get into it or it too failed to access it.
And since that's the filesystem on which few people are working, I don't think I can
unmount it, boot from disk or USB and manipulate a single directory.
As for NFS: yes, the access is through NFS (NAS, rather) so the
"irrelevance" of "root" permissions on the NFS server side might be
a plausible explanation. But what to do if that's the case?
And why only a single directory out of many which are OK?
Looking again, I see that the "rwx" permissions for "other" should have been sufficient for access. Sorry I missed that.
Can you connect to the NAS device's administrative interface (for NAS appliances, commonly done with a web browser)?
If you can see the files from Windows, can you also move or copy them to another directory?
I managed to cd/ls/etc. in the problematic directory by becoming the user of the directory
from which this "user_back" directory had been created
(had to change his password on the NIS server as root before, since he's no longer works here
it affects nobody). I guess the group "bin" somehow interfered when attempted
access as "root".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.