comments - How to replace a commented line in sudoers file with sed via Salt Stack? -


hi change following line in /etc/sudoers file on of salt minions.

# %wheel        all=(all)       nopasswd: 

with following:

%wheel          all=(all)       nopasswd: /usr/bin/salt* 

so far have tried following command along plethora of similar commands different options/syntax:

sed -i '/# %wheel        all=(all)       nopasswd: all/c %wheel          all=(all)       nopasswd: /usr/bin/salt*' /etc/sudoers 

i don't error message particular command, file not updated.

could provide me correct option/syntax specific use?

$ sed -i 's|# \(.*\)all|\1/usr/bin/salt*|' /etc/sudoers 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -