Score:0

How to make permanent changes to /etc/sudoers

ss flag

I'm trying to setup a Jenkins job that need to run an executable file under sudo

I do

  • sudo nano /etc/sudoers
  • add jenkins ALL=(ALL) NOPASSWD:ALL at the end of file
  • CTRL + X and confirm file save prompt

After that when I run the build that works fine but on the next run it fails and when I check /etc/sudoers I see that my change dropped...

What can be the reason and how to make the change work constantly?

Zatigem avatar
ru flag
See also [Sudoers file editing](https://askubuntu.com/questions/1088863/sudoers-file-editing)
guiverc avatar
cn flag
Are you using an *installed* system, as on *live* systems the settings aren't saved and subsequent runs start a new system.
JaSON avatar
ss flag
@Zatigem will the behavior in this case be different if to use `visudo`? I got `Sorry, user <ME> is not allowed to execute '/usr/sbin/visudo /etc/sudoers' as root on <REMOTE UBUNTU>.`
JaSON avatar
ss flag
@guiverc I use a Jenkins as permanently running service on remote Linux machine. Not a docker Ubuntu image (if you mean that)
cn flag
"setup a Jenkins job that need to run an executable file under sudo" Why? I would assume the current method on Ubuntu/Linux would be using a systemd service. I would avoid altering sudoers (my cloud images are all vanilla Ubuntu with 'hooks' to connect to a 2nd (user) partition names /u with Jenkins installed in /u/opt/).
I sit in a Tesla and translated this thread with Ai:

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.