Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Track a stolen laptop via a posted IP number UNIX
I travel with my Titanium often and I'm paranoid about losing it or having it stolen. So I have written three scripts that post my laptop's IP address to the Internet every 15 minutes. I figure if my laptop is stolen, I can use the IP address to help locate it, or at the very least, I can SSH into it and get/remove any sensitive information.

I would like to make this same service available to others using OS X (or any other *nix). I have posted instructions on my web site for those interested.

[Editor's note: I haven't tried this hint myself, but it looks relatively benign. You will need to request a (free) ID number from to use their FTP servers, but you could also use your own FTP server with some simple modifications to the scripts.

And if this sort of thing interests you, make sure you also read the Phone Home script hint, which discusses another means of getting information from your stolen Mac back to you.]
  • Currently 3.67 / 5
  You rated: 4 / 5 (3 votes cast)

Track a stolen laptop via a posted IP number | 9 comments | Create New Account
Click here to return to the 'Track a stolen laptop via a posted IP number' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Authored by: JohnnyMnemonic on Aug 20, '02 09:33:27AM

I found a shareware on Versiontracker that does this, also; Secure Notebook. I haven't used it myself, but the reviews are good. Is it worth $12? YMMV.

[ Reply to This | # ]
Authored by: j-beda on Aug 20, '02 10:31:10AM

You could also run one of the clients which updates the system's
address at their DNS servers. Then you just need to ssh into
or your own domain name if you so own one.

The client software periodically checks your ip address and makes an update to's system, all running quietly in the background as a startup process.

Of course, if someone were to steal your Mac OS X computer, wouldn't they need to do some pretty major reinstallation to get past your administrator password? Would this be likely to break any automatic system such as this that was installed?

I would think that an OS X theif would probably end up wiping the disk and reinsalling the OS before selling the system. But maybe they would boot it a few times and allow you to track it before it got wiped.

[ Reply to This | # ]
This could work as well...
Authored by: jimhoyt on Aug 25, '02 01:34:13PM
As noted in MacAddict.

Brigadoon Software offers a product called PC PhoneHome that sends you an email message containing the current IP address. It's available in a free version which won't survive a disk format or a $30 version which will.

[ Reply to This | # ]
This could work as well...
Authored by: kaptaineric on Aug 25, '02 07:58:15PM
Why not save yourself thirty bucks and have crontab do the work for you?

    Setup crontab to email your ip address every hour:

  1. At the terminal, type: sudo -s to become the root user.
  2. Type your password.
  3. At the root# prompt, type: pico /etc/sendip.ct
  4. In pico, type the following: 0 * * * * /sbin/ifconfig -a | mail
  5. Press ctrl x to exit.
  6. Press y to save.
  7. At the root# prompt, type: chmod 500 /etc/sendip.ct
  8. To activate the cron job we just created, type: crontab /etc/sendip.ct

    To list the active crontab(s), at the terminal type: crontab -l

    {each user can have their own crontab(s)}

    To stop crontab, type: crontab -r

[ Reply to This | # ]
This could work as well...
Authored by: toblak on Aug 26, '02 01:02:08AM

The problem with ifconfig is if you are behind a firewall it will return your local IP address.

[ Reply to This | # ]
This could work as well...
Authored by: TwoTimes on Jan 29, '04 10:20:39AM

Don't get fooled: if you read carefully the macphonehome FAQ's, you discover that the only protection against disk formatting is asking the user to set up an Apple Firmware Password to prevent boot from other drive...

[ Reply to This | # ]
better use MAC address
Authored by: chaosmind on Nov 27, '02 05:36:41PM
This is a good idea, but I question the validity of using something as ephemeral as an IP address.

If someone is smart enough to get around your account password (presumably by hacking root in single-user mode), they're certainly smart enough to change the IP address. And if they're not that smart, then they're just going to wipe the system with a new install, and therefore have an entirely new IP address anyway.

I'd think a better way of tracking your machine would be to keep track of the MAC address of your Ethernet or modem... Unfortunately, I'm not tech-savvy enough to know how to script such a tool. Some use of the 'ifconfig en0' command, perhaps? Just a thought.

[ Reply to This | # ]

better use MAC address
Authored by: signal15 on Nov 28, '02 02:19:31AM

The point of this IS to see what the ip has changed to, so you can track it down. What would be the point of keeping track of the MAC address? The MAC address never changes, well, unless you decide you want to change it to mess with your cable modem company or something.

In any case, you want two pieces of info, the actual ip of the machine, and the IP where it's coming from (like if it's behind a NAT device of some sort). I came up with an idea like this about 5 or 6 years ago, and I actually wrote a bunch of code for it (for windows). Alas, my hard drive with the code on it died, and I got a job that took up all my time so it never got finished. If anyone has a 3.8GB Quantum fireball w/ a good circuit board on it, I'll buy it from you. :)

[ Reply to This | # ]
Works for me
Authored by: clabough on Feb 07, '03 01:14:40PM

Thank you for this. My ISP keeps changing my IP on me, almost daily. Makes it hard to login remotely. One problem I had with getting this to work was when I copied the text for the .netrc file, it put an extra return after each line with text. There cant be any blank lines between the lines of text or the macro wont work. In fact it will go into an semi-infinite loop and probably bug the server administrator of the ftp server you are connecting to.

The other problem I ran into was that the grep search wasnt finding the correct spot. I ended up changing:
grep –A 3 "Your IP Address is:" ~/scripts/sendIP/File1 > ~/scripts/sendIP/File2


grep –A 3 "Address is:" ~/scripts/sendIP/File1 > ~/scripts/sendIP/File2

[ Reply to This | # ]