[Gllug] Remote logouts

Bruce Richardson itsbruce at uklinux.net
Thu Sep 27 18:56:04 UTC 2001


On Thu, Sep 27, 2001 at 06:09:03PM +0100, Dylan wrote:
> Can I set up a script on a workstation which will allow me to remotely 
> shutdown or reboot my server remotely without manual rlogin? Ideally I'd want 
> a link on my desktop which would at most ask for the server's root password.

ssh can execute commands remotely.  The way I would do that is to create
an otherwise harmless user account on the server and use sudo to give
the account permission to execute shutdown.  Then your script just needs
to execute this

ssh username at server /sbin/shutdown -h now 

in an xterm, which would allow you to type in your password (or ssh
passphrase, if you install your ssh public key on the server).

If you use ssh-agent and ssh-add, you won't even need to type your
passphrase (well, only the once, when you add the key to ssh-agent's
cache), and so can ditch the xterm.

If you aren't familiar with ssh, ssh-agent etc I can go into more
detail.

-- 
Bruce

Those who cast the votes decide nothing.  Those who count the
votes decide everything. -- Joseph Stalin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 261 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20010927/7a43fc24/attachment.pgp>


More information about the GLLUG mailing list