Bash script to modify sudoers file in remote hosts

Bash script to modify the sudoers file in remote hosts , in this case we have only one  server which is unixplanetary.mylabserver.com  and we are going to add  the line  “test        ALL=(ALL)       NOPASSWD: ALL ” to /etc/sudoers file .

#!/bin/bash

for i in  unixplanetary.mylabserver.com

do  echo ssh $i ” test      ALL=(ALL)       NOPASSWD: ALL ” >> /etc/sudoers

done

Leave a Reply

Your email address will not be published. Required fields are marked *