Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
![](/static/devrant/img/pipeless-devrant-banner-white.png)
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
fuego825yAssuming you have adequate (root, or sudo) permissions to do so, simplest way is to:
- create a new user group and add postgres and www-data users to that group
- chgrp the DATA directory to the new group. Can be done recursively if you want everything in the drive to be accessible to www-data and postgres, otherwise need to chgrp everything you want shared
- chmod the DATA directory to allow group R/W access. Again, this can be done recursively as well.
Example commands:
groupadd new_group
usermod -aG new_group www-data
usermod -aG new_group postgres
chgrp new_group $path_to_directory
chmod 664 $path_to_directory
To run chgrp and chmod recursively, add -R after the command.
Note: I'm ot sure what permissions you need, 664 is just an example. I'd suggest reading more on linux file permissions if you are new to them.
Man pages for everything:
https://linux.die.net/man/8/...
https://linux.die.net/man/8/usermod
https://linux.die.net/man/1/chgrp
https://linux.die.net/man/1/chmod -
Either ACLs or learn to do it the right, the POSIX way, the way group:user system was intended to be used, and quit fucking around and yelling a hammer is an idiotic thing because you cannot make a bolognese pasta with it.
-
@h4xx3r What would be "more handy" then ACLs where you can set permissions for an arbitrary amount of groups and users?
-
@sbiewald ACLs is a pain in the ass when it comes to administrating them.
ACLs should be the very last resort or a _very_ temporary workaround. Always. They should not be the solution.
Try managing thousands of servers where each directory is a potential landmine with ACLs! -
h4xx3r17165y@netikras I build mostly user-facing apps so in my case I blame the file/directory properties windows that let you only modify permissions for only one user and one group -_-
-
h4xx3r17165y@netikras I build mostly user-facing apps so in my case I blame the file/directory properties windows that let you only modify permissions for only one user and one group -_-
-
h4xx3r17165y@sbiewald it worked out in the end, but I'm astonished that only superusers can accomplish such thing, the files/directories properties window is incomplete.
-
h4xx3r17165y@halfflat learning a matching expression language is out of question for file management ò.O
-
h4xx3r17165y@netikras yep, but I like my Ubuntu mini server, unfortunately or fortunately <.<
If you know what I mean.
Related Rants
-
gururaju53*Now that's what I call a Hacker* MOTHER OF ALL AUTOMATIONS This seems a long post. but you will definitely ...
-
linuxxx65This guy at my last internship. A windows fanboy to the fucking max! He was saying how he'd never use anythi...
-
creedasaurus60
Another dev on my team just got a new machine. Before he came in today I made two separate USB installers and ...
LINUX MASTERS, I can't believe that linux didn't get rid off yet of the annoying user:group system.
Anyway, I have two pre-existing groups(postgres & www-data), now I need to enable both groups full access to an HD for data storing, currently the owner of /media/"user"/DATA is www-data but I need to enable the postgres group to operate in it.
I seached around and can't get around how to accomplish this, if it's even possible.
Help >_<
question
why?
groups
users
commands
linux