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 04-20-2014, 01:09 AM   #1
wvw
Member
 
Registered: Apr 2008
Posts: 33

Rep: Reputation: 15
File permission problem


Hello

A few days ago I posted a question regarding changing file permissions on a deleted user's files using the same subject, but somehow cannot find that post? Not sure if it was deleted or whether I am going mad!!

However I'll post it again as I really need help with this problem.

I have a little D-Link NAS which runs on a Linux-based OS. A while back one of the managers was doing some house cleaning on it and deleted a user who is no longer with the company. Having done so, a whole bunch of sub directories and files have now become inaccessible due to this deleted user.

A factory reset of the NAS didn't fix the problem.

So what I did was fired up a Linux Ubuntu Desktop machine and connected to the NAS via the network by mapping the NAS drive's main HDD Volume to the Ubuntu PC.

After this I could do a listing of the files and sub directories and noticed that the inaccessible files and sub directories belonged to a user with UID 501 who was part of a group with GID 501.

Having recreated a user with that UID & GID on the Ubuntu PC, I noticed the files and sub directories were associated with this user and group.
After this I was able to copy some of the sub directories and files from the NAS box to a Windows Server.

However I noticed there are still files which were not accessible after I created this user & group. I created the user blah and assigned it a UID of 501. I also created a group called test and assigned it an ID of 501.

When I logged into Ubuntu as user blah and wanted to chmod the files in order to give it 777 access the files still said permission denied.
While logged in as user blah I tried to chgrp & chown the files by assigning them to root, but I received invalid argument for both commands. I then logged in as root and assigned user blah to group sudo to give it full root access. After this I logged back in as user blah and tried the above 3 commands on the files and still received the same problems.

I had a look at these "problematic" files on the windows server and noticed they had
unix group\501 and unix user\nobody assigned to them with full permissions.

I then went back to the Ubuntu PC and created user nobody with a GID of 501. Still the same problems persisted.

My questions are:
1.) Is it possible to change these files' permissions, ownership & group to one of the existing owners & groups?
2.) Do I have to make these changes as the original owner and if so is it possible to find out who this owner was?

I am desperate to access these files, but cannot do so. I know these files are not corrupt as I can rename them and I can move them to sub directories inside their current directory, but cannot move them to parent directories.

If someone can please shed light on this problem or make some suggestions what I can do I will very much appreciate it.

Thanks in advance
w
 
Old 04-20-2014, 01:44 AM   #2
xode
Member
 
Registered: Aug 2003
Distribution: Mandrake 9.0; FC4; FC8; SUSE 10.3; SUSE 12.1; SUSE 13.2
Posts: 638
Blog Entries: 1

Rep: Reputation: 52
What happens if you login as root to the NAS and then try to copy the files to your windows server? I would also recommend that you UNassign user blah from group sudo and remove blah from full root access.
 
Old 04-20-2014, 04:13 AM   #3
wvw
Member
 
Registered: Apr 2008
Posts: 33

Original Poster
Rep: Reputation: 15
Hi Xode

To my understanding your suggestion doesn't work. Apparently it has already been tried on the NAS. However I am a little skeptical about this because when I asked for the login credentials to check (for instance) what tools are available, no one knew the username/password combination!?

However, assuming this doesn't work, are there other suggestions what I can do? I am quite desperate to get this working.

This NAS is in everyday use, so rebooting it ad hoc or taking it off site in order to physically remove the drives and slave them onto another PC is not an option.

Thanks
 
Old 04-20-2014, 12:07 PM   #4
xode
Member
 
Registered: Aug 2003
Distribution: Mandrake 9.0; FC4; FC8; SUSE 10.3; SUSE 12.1; SUSE 13.2
Posts: 638
Blog Entries: 1

Rep: Reputation: 52
Quote:
Originally Posted by wvw View Post

...A while back one of the managers was doing some house cleaning on it and deleted a user who is no longer with the company. Having done so, a whole bunch of sub directories and files have now become inaccessible due to this deleted user.
...

Thanks in advance
w
Whichever account that manager used to delete that user from the NAS is likely root on the NAS, or at least some kind of admin account on the NAS. You want to log in to the NAS with at least that account that manager had, and ideally root. So far, you have been issuing commands to the NAS from users on your Ubuntu desktop computer. Whatever privileges those users have on your Ubuntu desktop are NOT going to be the privileges those users have on the NAS, as they are remote users from the point of view of the NAS. In fact, it could be and it appears to be the case, that user root on your Ubuntu desktop has LESS privileges on the NAS than user blah on your Ubuntu desktop. Likely, user root on your Ubuntu desktop is user nobody on the NAS.

Consequently, you will need to find those root login credentials for the NAS or you will likely have to slave its hard drive to another PC. However, even if you have to slave the NAS's drive to another PC, it might be possible to keep the NAS up and running while you do that. For example, if the NAS has a RAID setup for its hard drives, you could pretend that one of the hard drives on the NAS failed, hot swap it out for a spare and then take and slave the "failed" drive to the other PC in order to access your files. In any event, you still want to find those root login credentials for the NAS or, at some point in the future, something will come up that will force you to take the NAS offline and likely force you to reinstall the OS on the NAS.
 
  


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
File's Permission problem ttphuong Linux - Newbie 4 10-12-2011 04:49 AM
problem with permission of the file ashyddiq Red Hat 5 07-31-2011 08:41 AM
file permission problem unleashed Linux - Security 9 04-20-2005 04:22 PM
File Permission Problem Scythe Slackware 1 01-12-2004 11:37 PM
File permission problem nuttyvishal4u Linux - General 1 08-21-2003 02:31 AM

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

All times are GMT -5. The time now is 09:54 AM.

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