Remote Access Hints

How do you manage a Mac that’s hundreds of miles away? (And no, FedEx has nothing to do with it.) Why, from Terminal, of course.

Wake a Sleeping Mac Remotely

The Mac’s remote-connection features are stellar, but they won’t do you any good if your Mac’s gone to sleep. To fix this predicament, go into System Preferences Energy Saver Options tab, and turn on “Wake for network administrator access.”

At this point, you could also use Wake550, a freeware program from http://www.tc.umn.edu/~olve0003/wake550.html, to rouse the snoozing remote Mac.

Or, you could hit Terminal to send a little networking pulse called a magic packet to rouse your sleeping Mac. Harry Potter would be proud.

  1. Before you leave home, write down the sleeping computer’s Ethernet and IP addresses.

    To do so, open System Preferences Network, open the Ethernet section, and click the TCP/IP tab. The Ethernet address is a series of six, two-character letter and number combinations, like 01:34:63:be:20:ad. The IP address is four blocks of numbers, like 192.168.1.6. You’ll need these numbers when it comes time to remotely wake your sleeping Mac.

    (Now you can leave your house.)

  2. At the new machine, open Terminal and create a script in a folder specified by your path settings. It should go something like this:

    #!/usr/bin/env python
    import socket
    s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    s.sendto('\xff'*6+'\x01\x34\x63\xbe\x20\xad'*16, ('192.168.1.255', 80))

    Note

    Make sure the last command (starting ...

Get Mac OS X Power Hound, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.