The folder /media/haider
has the permissions 700
and is owned by root
. This prevents anyone except root
from doing anything to that directory.
Assuming your user name and group name is both haider
you can change the ownership of the directory so you can access it:
sudo chown -R haider:haider /media/haider
This will set the user and group for /media/haider
to haider
and allow you to access the directory. This also applies to all files and subdirectories inside /media/haider
You could then set permissions to 750
to allow others in the haider
group to read
and execute
on the directory, but not allow write
access.
chmod 750 /media/haider
Other users in the haider
group still might not be able to see or access any files if the permissions on the files and directories are still 700
inside /media/haider
. It is fine to set the other directories to 750
but it is good practice to set files to 640
to avoid any possible security issues (of course, this is less of an issue for purely media files, but still good practice, nonetheless).
To set directories inside /media/haider/
to 750
:
find /media/haider/. -type d -exec chmod 750 {} \;
To set files inside /media/haider/
to 640
:
find /media/haider/. -type f -exec chmod 640 {} \;
I would recommend against setting 777
permissions on that folder for the purposes of allowing others access. Instead, utilize groups and set permissions on the folder to follow the principle of least priviledge.
thanks for your answer after trying your solution the ownership and permissions changed successfully but when i open the drive it's empty!! – Computer Mind – 2019-07-26T22:18:38.983
/media/haider
may need to be owned byroot
then. Try changing the ownership and group back:sudo chown root:root /media/haider
You might also need to do this with /media/haider/MyFiles:sudo chown root:root /media/haider/MyFiles
If that works I will edit my answer accordingly. – Mike LaMarca – 2019-07-26T23:16:52.367