Skip to main content

Poor Man's Ubuntu Lojack

So, I got to thinking, "What if my laptop were stolen? I don't keep anything 'private' on it, but it would be nice to get it back, if possible..." So, how do you track down a laptop that has been stolen? Lojack provides an option that works even if the system has been reformatted, but it only works with Windows and costs $$$. So, what are the OSS alternatives? There is one called Adeona, but they're having issues getting a service up and running to store your computer's location and other info when stolen. I also doubt that it works if the systems has been reformatted.

So then I got to thinking, "What about DDNS?" Dynamic DNS (or DynDNS, or DDNS) tracks your computer's current IP address and updates a service (such as DynDNS.org) every time your IP changes. This is useful if you know your computer has been stolen and you're wondering where it is.

It turns out I'm not the first person who's asked this question and configuring the service is unbelievably easy!

Here's the secure way to do it (grabbed from this website):

Step 1

First, you need to create an account with DynDNS to do so follow this howto: https://www.dyndns.com/services/dns/dyndns/howto.html.

Step 2

First we’ll install ssh and ssh-socket so we can send our DynDNS user and password encrypted instead clear text:

$ sudo apt-get install ssh libio-socket-ssl-perl

Step 3

Install ddclient:

$ sudo apt-get install ddclient

Step 4

The installation will prompt you some questions. For the first one it ask for your dynamic DNS provider, select www.dyndns.com:

ddclient01.png

Then, put your fully qualified domain name(s):

ddclient02.png

Now, your DynDNS requistered username and password:

dcclient03.png

ddclient04.png

And finally, type “web” as the DynDNS interface to use:

ddclient05.png

Ok, so long we’ve finished installing ddclient but there’s still more work to do in order to get it working properly.

Step 5

We, need to change the ddclient configuration file (/etc/ddclient.conf) in order to use ssh to send the username and password, and to properly check the IP adrress. From the command line open ddclient configuration:

$ sudo vim /etc/ddclient.conf

In the generated configuration file you’ll probably see something like the following (The parts in italics will be different, the bold parts are going to change so special attention on this):

# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
pid=/var/run/ddclient.pid
protocol=dyndns2
use=if, if=web
server=members.dyndns.org
login=your-dyndns-username
password='your-dyndns-password'
your-host-name.homelinux.net

Step 6
We need to change the configuration so ddclient get our public IP address properly, and to send our username and password over ssh.

DynDNS has a web interface to get your public IP address, this is equivalent to manually invoking http://checkip.dyndns.com/. But we need to properly configure this interface, so change the line use=if, if=web for the following:

use=web, web=checkip.dyndns.com/, web-skip='IP Address'

Second, add to your configuration file just below the initial comments the following:

ssl=yes
daemon=300

The above two lines tells ddclient to use ssl for its connection and to update your public IP address every 5 minutes (specified in secconds).

Step 7

Now, we must make sure that ddclient is set to run as a deamon. Edit /etc/default/ddclient:

$ sudo vim /etc/default/ddclient

And make sure that:

# Configuration for ddclient scripts
# generated from debconf on Tue Jan 29 20:23:32 CST 2008
#
# /etc/default/ddclient
# Set to "true" if ddclient should be run every time a
# new ppp connection is established. This might be useful,
# if you are using dial-on-demand
run_ipup="false"
# Set to "true" if ddclient should run in daemon mode
run_daemon="true"
# Set the time interval between the updates of the dynamic DNS name in seconds.
# This option only takes effect if the ddclient runs in daemon mode.
daemon_interval="300"

Step 8

Finally, restart your ddclient and if no error is printed you’re good to go:

sudo /etc/init.d/ddclient restart
 
Note that even though the password is stored in plain text on your system, you HAVE to be root or have root privs to access it. Also, this service should start running when the computer boots. I'll have to test this, but I'm pretty sure that is the case.

In addition to this, I recommend setting up a "Guest" account on your system that automatically logs in after 30 seconds at the login window. Give it Internet access but NO other access (restricted user account). This will give a thief a sense of being able to do something with the computer, even if they cannot.

If your laptop gets stolen, just jump into DynDNS.org and wait for the IP to change. When it does, run a traceroute and notify the police of any information you've collected.

Comments

Popular posts from this blog

Black Cursors on Win7/2008 R2 Using rdesktop for Ubuntu 10.04

I recently setup a Win 2008 R2 VM and proceeded to remote connect to it from Ubuntu 10.04. Everything worked perfectly except the mouse cursors were black (and some were corrupt). Solution? Use a newer version of rdesktop that doesn't ship with Ubuntu. There is a handy PPA that can be added using the following command: sudo apt-add-repository ppa:ricolai/ppa sudo apt-get update sudo apt-get install rdesktop [UPDATE] It appears ricolai may have removed the package from his PPA. To remedy the situation, I've uploaded the working binaries for x64. Sorry, I don't have the x86 any longer. More information on the bug can be found here: https://bugs.launchpad.net/ubuntu/+source/rdesktop/+bug/385974?comments=all

Remote Connection: Free NX vs. VNC

Apparently, there's some debate in the Linux world about remote connections. I've been using VNC for 8 years or so now. It's reliable, but definitely slow. I've found that NoMachine's NX Server (free edition) suits my needs best. It works even better than Windows' Remote Desktop, and of course much better than VNC (which really stinks). In my case, it opens a new session, when I connect to the server, but I think it can be configured to connect to an existing session as well. You might want to give it a try: http://www.nomachine.com/products.php I'll give it a try and get back to you all... UPDATE: I've installed the server on both my laptop and my desktop Ubuntu machines following the instructions found at https://help.ubuntu.com/community/FreeNX . The results are astounding! While not identical in terms of functionality to VNC, I personally prefer the results. It's actually closer to an RDP session. I haven't tested the client to the ful...

Mounting VMware VMDK Disks in Ubuntu (Linux)

Took me a while to find the info on this, but it's fairly simple once you piece together all the information out there. First off, I'm not converting this to VirtualBox. I'm simply accessing the HD as though it were mounted on my local file system (Ubuntu). The VMDK image is for a WinXP virtual machine. First off, verify you have vmware-mount on your system. Drop to terminal, type "vmware-mount". You should get info regarding usage. If not, you need to install VMware Server or VMware Workstation (it's bundled with them). When prompted during the install, say 'Yes' to installing the additional tools packages. Not sure which one it's in, but it's there. Sorry, perhaps someone else can clarify this point. Next, navigate to the location of your VMDK and type "vmware-mount -p .vmdk". This will show you a list of mount points within the file (first column). Create /mnt/ using "mkdir /mnt/ " Next, type "sudo vmware-m...