Gentoo Archives: gentoo-user

From: Walter Dnes <waltdnes@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] autoexpect?
Date: Sun, 27 Nov 2005 07:36:11
Message-Id: 20051127072924.GA25324@waltdnes.org
In Reply to: Re: [gentoo-user] autoexpect? by Andres Becerra Sandoval
1 On Fri, Nov 25, 2005 at 08:00:09PM +0100, Andres Becerra Sandoval wrote
2
3 > If you create a private-public pair with ssh-keygen you can access to
4 > the other machine without a password. Then your script would call ssh
5 > and probably "sudo /sbin/poweroff" as a parameter to halt the remote
6 > machine.
7
8 That's exactly what I do. I turn on my emergency system every couple
9 of weeks, "emerge --sync" and "emerge --ask --deep --update --world",
10 run etc-update if necessary and then shut down. I have a honking big
11 19" CRT on my desk at home, and the KVM is used elsewhere. The machine
12 name is m450 (450 mhz PIII). My main machine is m3000 (AMD64 3000+).
13 There is an ordinary user "waltdnes" on m450. /etc/sudoers on m450
14 contains the following line...
15
16 waltdnes m450 = (root) NOPASSWD: /sbin/poweroff
17
18 I have a short script ~/bin/stopm450 on m3000 ...
19
20 #!/bin/bash
21 ssh waltdnes@m450 sudo /sbin/poweroff
22
23 To shut down...
24 1) via ssh shut down unnecessary programs on m450
25 2) exit all ssh sessions to m450
26 3) stopm450
27
28 --
29 Walter Dnes <waltdnes@××××××××.org> In linux /sbin/init is Job #1
30 My musings on technology and security at http://tech_sec.blog.ca
31 --
32 gentoo-user@g.o mailing list

Replies

Subject Author
Solved - Re: [gentoo-user] autoexpect? Antoine <melser.anton@×××××.com>