Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > How do I issue Shutdown-h now command to other machine on network

How do I issue Shutdown-h now command to other machine on network
Thread Tools
Senior User
Join Date: Sep 2000
Location: Noo Yawk
Status: Offline
Reply With Quote
May 10, 2003, 04:27 PM
 
Hi lazy admin question

How using Terminal would I issue "Shutdown-h now" command to other machine on network.

I guess what I'm tring to do is take control of Terminal.app on the iMac (10.0.1.x) via airport, so that I can shut down the other machine without physically having to go over there. ?

I have admin on both machines.

Thanks very much!

Airport 'network'
TiBook OSX 10.2.5 (admin)
iMac 10.1.4
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
May 10, 2003, 05:01 PM
 
Can't you do it through ssh?
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
vsurfer  (op)
Senior User
Join Date: Sep 2000
Location: Noo Yawk
Status: Offline
Reply With Quote
May 10, 2003, 06:35 PM
 
Originally posted by Chuckit:
Can't you do it through ssh?
I was hoping there might be an easier way? -- SSH seemed complicated at first glance -- but having tried it I discovered it's not so bad after all!! Easier than I thought! Fun even.

However, somewhere there's not an association between the IP address of the other machine and its network name, so I have to look up 10.0.1.IP? as it keeps on changing.

But don't let that stop anyone posting any other solutions...

Thanks
(Last edited by vsurfer; May 10, 2003 at 06:54 PM. )
     
vsurfer  (op)
Senior User
Join Date: Sep 2000
Location: Noo Yawk
Status: Offline
Reply With Quote
May 10, 2003, 07:24 PM
 
Originally posted by vsurfer:
I was hoping there might be an easier way? -- SSH seemed complicated at first glance -- but having tried it I discovered it's not so bad after all!! Easier than I thought! Fun even.

However, somewhere there's not an association between the IP address of the other machine and its network name, so I have to look up 10.0.1.IP? as it keeps on changing.

But don't let that stop anyone posting any other solutions...

Thanks
Hmm wonder if I can play or start up iTunes playlists on that iMac remotely -- possible?
     
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
May 11, 2003, 02:57 PM
 
Originally posted by vsurfer:
Hmm wonder if I can play or start up iTunes playlists on that iMac remotely -- possible?
There's about a gazillion iTunes-control scripts (generally AppleScript-based) that use Remote Apple Events to control iTunes on a remote machine.

Remote Events have been a feature of the Mac OS for years and years. It's a too-often overlooked feature of the Mac and AppleScript, but it's as easy as:

Code:
set remoteMac to "eppc://192.168.1.1/" -- IP address of remote machine tell application "iTunes" of machine remoteMac activate -- start up play -- start playing end tell
Of course you could substitute the relevant track/playlist/whatever that you wanted to play, but you get the idea.

As for the remote machine shutdown:

shell:

ssh ip.remote.machine shutdown -h now

AppleScript:

Code:
set remoteMac to "eppc://192.168.1.1/" tell application "System Events of machine remoteMac -- assuming Mac OS X, use Finder for earlier OS versions shut down end tell
Gods don't kill people - people with Gods kill people.
     
vsurfer  (op)
Senior User
Join Date: Sep 2000
Location: Noo Yawk
Status: Offline
Reply With Quote
May 11, 2003, 07:54 PM
 
Thanks Camelot and Chuckit

The ssh worked great, and was easier than I thought. Got that semi-scripted apart from the password. (Maybe look into DSA keys?)

The apple events -- overlooked like many other mac features -- and something to look into.

Thanks very much for the tips.



PS. what kind of protocol is "eppc" ?
     
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
May 12, 2003, 09:17 PM
 
Originally posted by vsurfer:
Thanks Camelot and Chuckit

The ssh worked great, and was easier than I thought. Got that semi-scripted apart from the password. (Maybe look into DSA keys?)

The apple events -- overlooked like many other mac features -- and something to look into.

Thanks very much for the tips.



PS. what kind of protocol is "eppc" ?
Using keys would certainly save you having to enter a password each time you ssh'd to the remote machine. There's plenty of online tutorials that walk through the steps.

As for eppc://, I forget what the 'e' stands for, but the ppc part is 'process to process communication', a foundation of AppleEvents.
Gods don't kill people - people with Gods kill people.
     
Fresh-Faced Recruit
Join Date: Nov 2002
Location: mentalspace
Status: Offline
Reply With Quote
May 23, 2003, 09:12 PM
 
Originally posted by Camelot:
Using keys would certainly save you having to enter a password each time you ssh'd to the remote machine. There's plenty of online tutorials that walk through the steps.

As for eppc://, I forget what the 'e' stands for, but the ppc part is 'process to process communication', a foundation of AppleEvents.
Thanks Camelot.

Good stuff this.

Now were cooking with gas. OK well maybe with simple applescripts on the other machine across the network, but a start.
----------
I did try other method and got following response

[localhost:~] borg% set remoteMac to "eppc://10.0.1.2"
set: Variable name must begin with a letter.
Not sure why
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:12 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2