I'm trying to give a particular user superuser privileges, specifically the global write permissions that root has. The user in question must have these permissions without using sudo
. It's a user that runs a service that is trying to write a file to a directory that it doesn't have write permissions on. I don't know what directory that is, or I would simply change the permissions on it as appropriate. I've tried following the instructions here without success: add new user with root access in Linux. The user in question is elasticsearch
. I have the following lines in /etc/sudoers
:
root ALL=(ALL:ALL) ALL
elasticsearch ALL=(ALL:ALL) ALL # Attempt to give elasticsearch the same permissions as root
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
Here is my proof that elasticsearch
is a member of the sudo
group, but yet still does not have write permissions on /
:
[16:22:32][root@pre-staging:/]$ groups elasticsearch
elasticsearch : elasticsearch sudo
[16:22:44][root@pre-staging:/]$ sudo -u elasticsearch touch foo
touch: cannot touch `foo': Permission denied
What am I missing about why elasticsearch
doesn't have the write permissions I need it to have?