have a bash script remotely shutdown another computer on the lan

Posted by gletscher on Super User See other posts from Super User or by gletscher
Published on 2010-03-27T14:09:26Z Indexed on 2010/03/27 14:13 UTC
Read the original article Hit count: 337

Filed under:
|
|
|
|

Hi I want to write a bash script that when called shuts down another computer on the lan. Maybe using ssh? The other computer is an ubuntu machine. Now I'm not sure how to send e.g. a

sudo shutdown -h now

command from withing a bash script to the ssh after logging in. Also I'm not sure how to obtain the rights for the sudo command, hence how to handle the communication between the server and client from within a bash script. Any suggestions are greatly appreciated.

© Super User or respective owner

Related posts about linux

Related posts about ubuntu