On Fri, Nov 25, 2005 at 08:00:09PM +0100, Andres Becerra Sandoval wrote

> If you create a private-public pair with ssh-keygen you can access to
> the other machine without a password. Then your script would call ssh
> and probably "sudo /sbin/poweroff" as a parameter to halt the remote
> machine.

  That's exactly what I do.  I turn on my emergency system every couple
of weeks, "emerge --sync" and "emerge --ask --deep --update --world",
run etc-update if necessary and then shut down.  I have a honking big
19" CRT on my desk at home, and the KVM is used elsewhere.  The machine
name is m450 (450 mhz PIII).  My main machine is m3000 (AMD64 3000+).
There is an ordinary user "waltdnes" on m450.  /etc/sudoers on m450
contains the following line...

waltdnes  m450 = (root) NOPASSWD: /sbin/poweroff

  I have a short script ~/bin/stopm450 on m3000 ...

#!/bin/bash
ssh [EMAIL PROTECTED] sudo /sbin/poweroff

  To shut down...
  1) via ssh shut down unnecessary programs on m450
  2) exit all ssh sessions to m450
  3) stopm450

-- 
Walter Dnes <[EMAIL PROTECTED]> In linux /sbin/init is Job #1
My musings on technology and security at http://tech_sec.blog.ca
-- 
gentoo-user@gentoo.org mailing list

Reply via email to