top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Change sudoers remotely on CentOS Linux

+1 vote
315 views

I've been asked to give someone sudo rights across an entire environment without the benefit of something like puppet or chef or cfengine et al.

What I've come up with so far is this:

ssh -t miaprbicsra04v sudo -S /bin/echo "rsherman ALL=(ALL) NOPASSWD: /sbin/service /bin/rm /usr/bin/du /bin/df" >> sudo tee /etc/sudoers

Right now that's just to one host, but I plan on substituting a list of hosts once I get farther along. Problem is, the output hangs on the tee command. Not sure why. Any suggestions?

posted Jul 8, 2013 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+2 votes

I am used to traditional update-rc.d et all.

Now I wonder how to add a a script that used to called by init.d (with start/sop ..) to the new "service start xx" regime.

All the tutorials I found talk about how to use update-rc.d..

+3 votes

I googled to see how I might restart the network interface in CentOS. I initially tried before googling:

sudo service network restart

I noticed that only the loopback interface was restarted. To confirm this I did:

service network stop

and then did

ifconfig

and the loopback info was gone. I then found ifconfig eth0 up/down and tried those and that did what I is was looking for. Why doesn't "service network restart" restart all interfaces?

+1 vote

I have a problem in that at first all my log files were dated 12-31-1969 and logrotate has:

# more /var/lib/logrotate.status
logrotate state -- version 2
"/var/log/yum.log" 1969-12-31-20:26:1
"/var/named/data/named.run" 1969-12-31-20:26:1
"/var/log/httpd/error_log" 2015-8-27-4:43:1
"/var/log/wtmp" 1969-12-31-20:26:1
"/var/log/chrony/*.log" 2015-8-19-22:0:0
"/var/log/spooler" 1969-12-31-20:26:1
"/var/log/btmp" 1969-12-31-20:26:1
"/var/log/maillog" 1969-12-31-20:26:1
"/var/log/wpa_supplicant.log" 2015-8-19-22:0:0
"/var/log/secure" 1969-12-31-20:26:1
"/var/log/ppp/connect-errors" 2015-8-19-22:0:0
"/var/log/messages" 1969-12-31-20:26:1
"/var/log/cron" 1969-12-31-20:26:1
"/var/log/httpd/access_log" 2015-8-27-4:43:1

How do I get this file rebuilt with the dates currently on the files listed?

+2 votes

I'm having an issue getting a C6.6 install to work on a 3 TB dual hard drive system, raid 0. I'm hoping that someone here can help.

So, I install as normal, but then reboot, and it comes to a grub prompt. Going into the system via Linux rescue, I see that most of the files dealing with the kernel haven't been installed.

I asked the maker of the server and he said that they have noticed this happen recently. A solution is to put the kernel files on a thumb drive, and then point the OS to look for them there.

I have yet to try it, but is there a better way to deal with this issue that anyone else has done?

...