Operating System - HP-UX
1748032 Members
4694 Online
108757 Solutions
New Discussion

Re: Edit /etc/sudoers through command Line

 
kgpenator
Advisor

Edit /etc/sudoers through command Line

Hi All,

I want to edit the contents of the sudoers file across 100 servers.Changes will be same (delete some user name in sudoers file).

although user doesn't exist in the server .Due to audit  , i need to delete the user name in sudoers across all servers. I have the access to all servers through ssh (passwordless login).How to acheiev this?

Please suggest . thanks in advance

1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: Edit /etc/sudoers through command Line

I don't think you can script sudoedit?  Unless you can replace VISUAL or EDITOR by your script to edit the sudoers file.  This way sudoedit will validate your changes.

 

>Changes will be same (delete some user name in sudoers file).

 

Is this all on one line?  You can use sed to delete matches.