Score:0

How to add permission to user for one specific command

in flag

I have a Jenkins job which runs as Jenkins user. The script it runs need to delete one folder which owns www-data user. Jenkins user has not sudo privileges and I dont want to give it to him. The command looks like:

rm -rf /var/www/deploy-old 

I don't want to add sudo privilege for rm command to Jenkins, but only for whole command including path. Is it possible or not?

vanadium avatar
cn flag
Not possible, afaik. You may rather work with groups. Make that user member of the group that owns the /var/www directories, give the group read/write permissions and members of the group will need to changethese folders.
in flag
Ok, it seems like the only way. Thanks.
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.