Re: change sudoers remotely

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



You might want to have a look at ansible (www.ansibleworks.com) for
orchestration/configuration tasks like this.  Very simple to set up
and requires nothing but ssh and python on the target host.  Takes
care of all the ssh and sudo user transitions for you.  For your case
it would be as simple as.

    yum install ansible
    echo target_host > hosts
    ansible target_host -i hosts -s -m lineinfile -a
'dest=/etc/sudoers regexp="^username ALL=(ALL) NOPASSWD:"'

replacing target_host and username as appropriate.

You can even package that invocation in a playbook so you don't have
to remember all the details next time.

Hope this helps.

K
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux