LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Change permissions - permission denied (https://www.linuxquestions.org/questions/linux-newbie-8/change-permissions-permission-denied-4175728944/)

jerxjac 09-14-2023 09:14 AM

Change permissions - permission denied
 
I try to recover a HDD from my NAS, using Diskinternals linux reader (program running under Windows) but one folder had the rights specifically for one user.
So I now have the problem that I can’t copy/move this folder and it’s files.
I tried under Linux different chmod with as last chmod -R 777 ./ But that didn’t work

How can I change the rights to the Stack folder, it looks like i'm missing rwx on the 3 last positions (when compared to the other)

Code:

drwxrwxrwx+ 13 root kali 4096 Aug 17 09:31 Public
drwxrwxrwx+  2 root kali 4096 Dec 11  2014 SmartWare
drwxrwx---+ 10 root kali 4096 Aug 25 08:21 Stack
drwxrwxrwx+  2 root kali 4096 Dec 11  2014 TimeMachineBackup
drwxrwx---+  2 root kali 4096 Sep  4 05:18 UserOne


computersavvy 09-14-2023 12:16 PM

What is the OS used on the NAS and how is it configured?
The NAS itself is blocking access and using 'chmod -R 777 ./' is not really a good idea since that affects both directories and files under the stated beginning folder.

For other users to access either Stack or UserOne the NAS must be configured to allow that. Start with the config on the NAS and don't damage things with random chmod commands.

jerxjac 09-14-2023 12:55 PM

The operating system of the NAS is based on Linux.
Problem is that the NAS does not work anymore so I had to remove the HDD.
No way to change the users permissions that way.

All I want now is to rescue my files and format the HDD to be used somewhere else

Is there a possibility to access and copy the folder 'Stack' ?

sydni77 09-14-2023 09:28 PM

Quote:

Originally Posted by jerxjac (Post 6453714)
The operating system of the NAS is based on Linux.
Problem is that the NAS does not work anymore so I had to remove the HDD.
No way to change the users permissions that way.

All I want now is to rescue my files and format the HDD to be used somewhere else

Is there a possibility to access and copy the folder 'Stack' ?

I have some options that you can try: geometry dash
  • Boot the HDD as an external drive on another Linux machine. Mount the drive and use sudo to override permissions and copy the Stack folder.
  • Boot the HDD on a Linux live USB. Access the filesystem from the live environment as root to bypass permissions.
  • Attach the HDD to another Windows machine using a SATA-to-USB adapter. Windows ignores Linux permissions so you can directly access the folders.
  • Use a Linux recovery boot disk that contains utilities like chroot and chmod to reset the file permissions on the HDD before copying.
  • As a last resort, use dd or a forensic utility to image the full HDD, mount the image, and extract the Stack folder with elevated permissions.

The key is booting the HDD on a system that gives you root access. Once bypassed, you can backup or copy out the Stack folder and reformat for reuse.

rzdndr 09-22-2023 10:15 PM

This depends on the disks health status. If the disk is corrupted you might not be able to access the disk.

You can boot any Linux live system. Then mount the disk.

Switch user to root (using su). Then do a chmod 777 Stack. This might not work since you do not have a kali group on the live system. If that does not work you can use chmod o=rwx Stack. This will only change permissions for users not in the files group.


All times are GMT -5. The time now is 08:27 AM.