Score:0

group of users to run a systemctl service without sudo and passwd

de flag

I would like to grant permission to a group of users to run a systemctl service that only sudo users can executable.

I put the etc/sudoers (visudo) command below and it works:

%group_a ALL=(root) NOPASSWD: /bin/systemctl enable --now app_xxx@user_01

But would it be possible to pass the $USER environment variable as below?

%group_a ALL=(root) NOPASSWD: /bin/systemctl enable --now app_xxx@$USER

I tried this to no avail. I didn't understand properly how to handle environment variables in etc/sudoers. Any indication? Or suggestion of another approach?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.