Page 1 of 1

How to create the /media/pi folder with correct permissions?

Posted: Thu Aug 31, 2017 9:33 am
by VascoFerraz
Hi,

I accidentally removed the pi folder in the media folder.

I noticed that (on another box) the pi folder has the following permissions: drwxr-x---+

If I create this folder I don't get the "+" sign. How can I restore the folder with the correct permissions?

Thanks.

Re: How to create the /media/pi folder with correct permissions?

Posted: Thu Aug 31, 2017 11:01 am
by Paeryn
The + after the permissions means there are extended permissions via ACL (access control list). They can be shown with getfacl and set with setfacl
It allows giving permissions to specific users. This is because /media/pi belongs to root but you want to give user pi access but nobody else.

/media/pi on my rpi has r-x set specifially for the user pi. You can do this with

Code: Select all

sudo setfacl -m "u:pi:r-x" /media/pi

Re: How to create the /media/pi folder with correct permissions?

Posted: Thu Aug 31, 2017 11:54 am
by VascoFerraz
Thank you so much