LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 02-28-2018, 01:00 AM   #1
kaza
Member
 
Registered: Apr 2010
Distribution: FC17
Posts: 343

Rep: Reputation: 2
Can't "cd/ls/etc" directory even as "root"


Hello!

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.

So, what can cause such a strange behavior?

TIA,
kaza.
 
Old 02-28-2018, 06:30 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
All I can see is that the directory is in the bin group, which you appear to be part of as root. Perhaps try changing the group, chgrp to root.

Why in the world do all of your ls calls have a \ in front of them? Alias or something?

You didn't say, I'm sure you're checking, but if you feel there's nothing in there, then I'd also try "rm -rf" for that directory.
 
Old 02-28-2018, 06:31 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Another option is to live boot off of DVD or USB, mount your drive and then do what you want as root to that file system and directory.
 
Old 02-28-2018, 09:45 AM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213
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.
 
Old 02-28-2018, 11:59 AM   #5
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Quote:
So, what can cause such a strange behavior?
One possible answer is some Windows virus is encrypting this volume.
 
Old 02-28-2018, 03:39 PM   #6
kaza
Member
 
Registered: Apr 2010
Distribution: FC17
Posts: 343

Original Poster
Rep: Reputation: 2
Thanks for the many replies.

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.
 
Old 02-28-2018, 04:20 PM   #7
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213
Quote:
Originally Posted by kaza View Post
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?
 
Old 03-01-2018, 02:12 AM   #8
kaza
Member
 
Registered: Apr 2010
Distribution: FC17
Posts: 343

Original Poster
Rep: Reputation: 2
Solved!

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".

Thanks for everyone for the help,
kaza.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Terminal directory in Backtrack 5 changed from "root@bt~#" to "sh-4.1# mdtmaverick Linux - Newbie 2 09-17-2012 02:44 PM
".config" and ".kde" folders are being created under root directory (Slack Current) piratesmack Slackware 8 03-12-2011 11:06 PM
newbie question: whats the difference between "su root", "su" and "su -&quo mojarron Slackware 9 12-07-2009 04:08 PM
Logged in as "root"/Fedora 8 but get "Operation not permitted" when using "chmod etc gosunlee Linux - Newbie 7 02-10-2008 05:56 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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