How Cam I Reboot a Remote Mac

ARD is unable to restart a Mac on a remote network (Choose "Restart..." from Manage menu in ARD, select Mac on remote network. Result: Task fails).

Does anyone know a workaround? Unix command (e.g., reboot) perhaps?

Mac Pro 2 x 2.66 GHz Dual-Core Intel Xeon, Mac OS X (10.5.8)

Posted on Dec 10, 2010 12:53 PM

Reply
15 replies

Dec 11, 2010 8:00 AM in response to Brian Nesse

There's obviously a whole lot more to it. I'm not very Unix savvy, so was hoping someone could spell it out in a more detailed way. Here's some elements to the solution. Note the areas with details needed:

1) On the remote Mac, turn on Remote Login on Sharing tab of System Preferences.
2) On router at remote site, set router to port forward the following ports/protocols: [DETAILS NEEDED]
3) Open Terminal on local Mac/ARD management console, and login to remote Mac using ssh [DETAILS NEEDED]
4) Once logged in at remote Mac Terminal session, enter following command to force a restart: sudo reboot
or
sudo shutdown -r now

Dec 11, 2010 8:31 AM in response to William W. Higgins Jr.

Hi

2 - Port 22. Apple provide a list of well-known used ports. Some of them specific to Apple:

http://support.apple.com/kb/ts1629

3 - ssh admin@IPaddressotargetmac

At the prompt type 'y' or 'yes'. Then type the password of the local admin's account. You won't see it being typed. Issue the commands as Brian advised. Note the admin name should be the shortname of the local admin account.

Tony

Jan 14, 2011 8:22 AM in response to William W. Higgins Jr.

Turns out there's a thread that describes the root cause of why my Mac Mini kept going off-line here. Bottom line is either a flaky ethernet adapter or Mac OS X that doesn't throttle back the ethernet speed to match cable and switch capabilities. I manually changed the Mac Mini's ethernet speed to 100baseTX (down from Automatically=1000baseT), and my Mac Mini has been up and running/available via ARD for several days.

Another solution is to buy a $29 USB to Ethernet adapter and use it instead of the hard-wired ethernet port. I believe the USB to Ethernet adapter maxes out at 100baseTX, so there's no increase in speed over my manual override, but if the ethernet port on the Mac Mini dies entirely, this would be a less expensive option than replacing the motherboard (ethernet port on Mac Mini is soldered onto motherboard).

Will ship my Mac Mini back to the remote location next week, and see how it goes. Nice to get to the bottom of things, but not happy that this issue (bad ethernet port) has been lurking around the Mini for several years, and I'm not able to get Gigabit speeds.

The link I posted above wasn't working initially. Here's the URL:

http://discussions.apple.com/thread.jspa?messageID=6335353&#6335353

Message was edited by: William W. Higgins Jr.

Dec 14, 2010 4:14 PM in response to varjak paw

Dave-

Thanks for your reply. Your solution seems to work, but (here's the hard part) I've not been able to reproduce the original condition where the remote Mac was not responding properly to ARD commands. When the Mac on the remote network became unresponsive, my first try was to choose Restart... from the Manage menu in ARD (Result: Task fails). I was looking for a Unix workaround to try next.

Tony's solution seems promising, but again, I've been unable to reproduce the original condition where the remote Mac was not responding to ARD commands.

I've tried both Tony's and your solutions on a Mac that is responsive to ARD commands. Both work, but are a bit unnecessary when the Mac is responding properly to ARD (i.e., it's easier to just use the ARD restart command directly).

IF only the darn Mac would become unresponsive again I could test Tony's solution properly!

I'll post back when it does.

Dec 31, 2010 7:32 AM in response to William W. Higgins Jr.

Mac on remote network became unresponsive in ARD (Current Status shown as "Offline" actually), but turns out that the remote Mac was powered off.

Obviously, no command is going to work in that instance. I'd like to explore how the Mac became powered off. Is there a log somewhere that says why a Mac shut down? Several potential ways a Mac can get shut down:

1) User choses Shutdown... from Apple menu;
2) Somebody presses and holds power button on computer enclosure;
3) Loss of power;
4) Other.

Knowing which of these occurred would be helpful. Is there a log that identifies how Mac came to be powered off?

Dec 31, 2010 11:32 AM in response to William W. Higgins Jr.

Hi

You could use Console to do this. Look at the All Messages Log. For 10.6 you should see entries similar to this:

The Date 14:36:10 shutdown (2303) halt by 'someonesname':
The Date 14:36:10 shutdown (2303) SHUTDOWN_TIME: 1293806170 32162
The Date 14:36:10 kernel systemShutdown true
The Date 14:36:18 imagent (229) Quit - notifying about shutdown
The Date 18:27:04 kernel systemShutdown false
The Date 18:27:17 kernel Previous Shutdown Cause: 5

The Previous Shutdown Cause: 5 meant Shutdown was selected from the Apple Menu. Shutdown Causes 0 and 1 IIRC is for power interrupts. 2 and 3 for restarts - after a Software Update for example. It's been a while but in any case that's what I recall. Maybe someone else knows more? Can't recall ever seeing shutdown cause 4? Depending on the version of the OS you may see something slightly different but generally along the same lines.

Tony

Jan 5, 2011 9:30 PM in response to Antonio Rocco

Thanks Tony.

Could not "rewind the log" quickly enough. Thousands of messages reading:

The Date 2:52:25 AM sandbox[29178] sshd(30933) deny-mach-per-user-lookup

Roughly 4 or 5 per minute, going on for days on end. Not sure what this is, but guessing it's BAD. Literally could not scroll the log back far enough to my last unexpected shutdown (less than a week ago). Any idea what this is indicating?

Jan 6, 2011 12:32 PM in response to William W. Higgins Jr.

Hello William

From what you've posted it looks like an ssh attack. Basically someone trying to barge down the door and hi-jack your server. Have a look at the secure.log. From terminal issue "tail -f /var/log/secure.log" (without the quotes) or use Console again. The log should list the IP address(es) attempting the connection. I can see why you've left ssh enabled (assuming OSX Server) or you've enabled it for OSX Client, but if you're going to expose the port to external access I would either switch it off completely and use ARD. If you absolutely have to have ssh either secure it or use a VPN.

Tony

Jan 12, 2011 10:17 PM in response to Antonio Rocco

Remote Mac was going "offline" (as reported by ARD) way too regularly. Kept thinking it had "hung" or crashed. Wanted to reboot the remote Mac without human intervention on the other end (several time zones away). That was the impetus behind my original post.

In the latest "hang" or "crash," I had someone reboot the remote Mac by hand. Press/hold the power button until shutdown, wait a minute, then press the power button momentarily to restart. Only this time, the remote Mac never came back online (or "available" as reported by ARD; kept reporting the remote Mac as "offline" instead). Began to suspect a hardware problem or worse (infection/etc.). Had the unit shipped back to me.

The "remote" Mac booted headless on my local network without a problem, but then went "offline" (as reported by ARD) within 10 minutes. Hooked up a keyboard, monitor, and mouse. Mac still boots normally, but the Network pane of System Preferences indicates that the ethernet cable is unplugged. It isn't.

99.9% sure this is a hardware issue now, specifically a bad ethernet port.

Off to the Apple Store I go for repairs.

Thanks again Tony for all the suggestions.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How Cam I Reboot a Remote Mac

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.