Asked by Bartosz Wierzejewski on 2009-10-02

Hallo. I have a proposition to this apps. I think it will be helpful to add a button "ShutDown" to the top menu to send an order to remote pc's.

Question information

English Edit question
Ubuntu vinagre Edit question
No assignee Edit question
Solved by:
Bartosz Wierzejewski
Last query:
Last reply:

you can create a script that connects via ssh to remotely shutdown a system:

ssh user@server "sudo shutdown -h now"

Should do it nicely

Bartosz Wierzejewski (bartekw) said : #2

Hm, I have a 4 rooms with Windows Xp PC's and VNC server installed. I use vinagre to connect to this VNC servers.

I dont know about vnc, i find it redundant and slow. ssh will allow you to easily write a script to shutdown a PC by name, you can then have a list of PC names in a text file and have another script (or a command) cycling through the computer list and running the first script

lets say we have a file in /bin/bash named 'remote-shudown' and it contains:

ssh $1@$2 sudo shutdown -r now

then the command would be:

for i in $(cat serverlist.txt) do; remote-shutdown username $1; done

which will use the command above, cycle through the file 'serverlist.txt' and reboot them as username (you will need to specify this). You will also need to modify the systems so that your username (or a special username) is allowed to use shutdown without entering a password (check visudo for more information)

Once you get this perfected, you can shutdown huge swathes of systems as long as you have a logical connection to them. This beats VNCing to each system in turn and initiating a manual shutdown as you can simply kick off the command and leave the building safe in the knowledge that all systems that you name will be turned off.

Bartosz Wierzejewski (bartekw) said : #4

I found a resolution.

I need function "under" vinagre interface.
net rpc shutdown -f -I IP_ADDRESS -U USER_of_remote_system%PASSWORD

Please add it, this will be very usefull!