- Ubuntu 14.04 LTS Desktop
/media/gal_db$ ls -al drwxrwx--- 6 admin shared_disk 4096 Aug 15 13:31 . drwxr-xr-x 6 root root 4096 Aug 13 12:54 .. drwx------ 3 postgres shared_disk 4096 Aug 15 14:28 database /media/gal_db$ members shared_disk gal admin postgres
Remove postgres from shared_disk to limit access to filesystem
sudo deluser postgres shared_disk
Try logging into database as user gal
psql -U gal Password for user gal: psql: FATAL: could not access directory "pg_tblspc/16399/PG_9.3_201306121/16401": Permission denied
Re-add postgres user to shared_disk
sudo adduser postgres shared_disk
Try logging into database as user gal again
psql -U gal Password for user gal: psql (9.3.5) Type "help" for help. gal=>
Success. And confusion.
- Why does postgres need to be a member of shared_disk to access the database directory?
- Isn't it enough that postgres is the owner of the database directory?