<div dir="ltr">Paul: I'm 'administrator' on both the local and remote machines <div>Chris: I believe the keys have been added - if they weren't i wouldn't be able to ssh in without using a password.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 2 October 2013 09:25, chrisk <span dir="ltr"><<a href="mailto:c.kirby@cairn-research.co.uk" target="_blank">c.kirby@cairn-research.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Are you able to add the key to /root/.ssh/authorized_keys?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On Wed, 2013-10-02 at 09:20 +0100, Dan Attwood wrote:<br>
> I've tested the ssh part and that works fines, it log straight in.<br>
><br>
><br>
> in visudo I added:<br>
><br>
><br>
> administrator ALL=(ALL:ALL) NOPASSWD: /sbin/shutdown<br>
><br>
><br>
> on the local machine I then run:<br>
><br>
><br>
> ssh -t 10.0.100.38 /sbin/shutdown -r 03:00<br>
><br>
><br>
><br>
> but it says: shutdown need to be root<br>
><br>
><br>
> if I run it with sudo:<br>
><br>
><br>
> ssh -t 10.0.100.38 sudo /sbin/shutdown -r 03:00<br>
><br>
><br>
><br>
> it then asks for a password.<br>
><br>
><br>
> I'm guessing i've got something wrong in the sudoers file somewhere.<br>
><br>
><br>
><br>
><br>
> On 1 October 2013 17:25, Paul Littlefield <<a href="mailto:info@paully.co.uk">info@paully.co.uk</a>> wrote:<br>
> On 01/10/13 17:09, Paul Littlefield wrote:<br>
> I might have a google for you now...<br>
><br>
><br>
> ...yes, lots on this particular subject!<br>
><br>
> <a href="http://bit.ly/1hijZQe" target="_blank">http://bit.ly/1hijZQe</a><br>
><br>
> It seems you have to check 3 things...<br>
><br>
> 1. Who you are logging in as and exactly what SSH key they<br>
> use.<br>
> 2. What that user is allowed to do in the /etc/sudoers file.<br>
> 3. What SSH allows you to do.<br>
><br>
> I have just tried...<br>
><br>
> ssh me@myserver sudo ls<br>
><br>
> ...and it failed with errors.<br>
><br>
> ssh -t me@myserver sudo ls<br>
><br>
> ...worked and asked me for a password.<br>
><br>
> So...<br>
><br>
> 1. Check your passwordless SSH key works normally first. You<br>
> can specify which one to use with the -i option.<br>
> 2. Try and read the massive 'man sudoers' page. The fix for 1<br>
> person seemed to be...<br>
> %sudo ALL=(ALL:ALL) NOPASSWD: ALL<br>
> ...please check this out, because it seems a bit risky to<br>
> me.<br>
> or maybe<br>
> admin ALL=(ALL:ALL) NOPASSWD: REBOOT<br>
><br>
><br>
> 3. ssh -t will fix it.<br>
><br>
><br>
> Hope this helps, and let me know how you get on.<br>
><br>
><br>
><br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> Kent mailing list<br>
> <a href="mailto:Kent@mailman.lug.org.uk">Kent@mailman.lug.org.uk</a><br>
> <a href="https://mailman.lug.org.uk/mailman/listinfo/kent" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/kent</a><br>
><br>
><br>
<br>
<br>
_______________________________________________<br>
Kent mailing list<br>
<a href="mailto:Kent@mailman.lug.org.uk">Kent@mailman.lug.org.uk</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/kent" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/kent</a><br>
</div></div></blockquote></div><br></div>