Uwe Hermann: DIY secure pseudo-DDNS setup using ssh
Here's a quick HOWTO for setting up your own secure pseudo-dynamic DNS (DDNS) server.
It's not a "real" DDNS service, i.e. you won't be able to use standard DNS tools or protocols to talk to the server, but it covers 98% of all functionality I expect from a service such as DynDNS or similar ones: It tells me the IP address of a certain box which doesn't have a static IP address (e.g. my home-server).
Requirements
You'll need:
- A Linux box with dynamic IP address (dial-up modem/DSL), I'll call it homeserver from now on. This is the box whose public IP address I want to be able to find out.
- A public Linux box with static IP address (or known DNS name) where you have a user account and ssh access. I'll call this box publicserver.
- Add a non-root user account (e.g. user) just for the purpose of this mechanism: adduser user. The user doesn't need any special permissions.
- Create an ssh key with an empty passphrase for the user: ssh-keygen -t rsa -b 2048. This is required as you'll want to run ssh commands via cronjob later.
-
Add a cronjob which runs regularly (as user), e.g. once per 10 minutes:
5,15,25,35,45,55 * * * * user ssh -x user@publicserver /home/user/updateip
- Add a non-root user account (e.g. also named user) just for the purpose of this mechanism: adduser user. The user doesn't need any special permissions.
- Add the public ssh key (/home/user/.ssh/id_rsa.pub) of user@homeserver to the publicserver's /home/user/.ssh/authorized_keys, so that the homeserver user can login on the remote publicserver without password (i.e. non-interactively).
- Put the updateip script (see below) into /home/user/updateip and make it executable.
#!/bin/sh # Update IP address. echo $SSH_CLIENT cut -d " " -f 1 > /home/user/homeserverip.txtSo to summarize: the homeserver's user simply executes the updateip script on the remote publicserver, which in turn abuses the $SSH_CLIENT environment variable which contains the public IP the ssh connection was coming from (which is exactly what we're looking for). We store that IP in the homeserverip.txt file, which will always contain the latest-known IP address of the homeserver (because of the cronjob). Getting the current homeserver IP address You can now retrieve the current IP address of your homeserver easily from anywhere (i.e. from your laptop when you're in another, possibly hostile network) in order to connect to your homeserver:
$ ssh -x user@publicserver cat /home/user/homeserverip.txtTo make this a bit more convenient you can add a shell alias (e.g. into ~/.bashrc):
alias homeserverip='ssh -x user@publicserver cat /home/user/homeserverip.txt'Or, to conveniently login to your homeserver as user:
alias homeserverlogin='ssh -x user@ ssh -x user@publicserver cat /home/user/homeserverip.txt 'Conclusion, advantages This may not be the most elegant solution, and it has a number of drawbacks when compared to services such as DynDNS, but it's sufficient for me and it also has some advantages:
- You're not dependent on the DDNS service provider. For instance DynDNS recently changed their policy to only allow one update per 28 days, which totally sucks. They then disabled the service completely until I updated my ddclient config and contacted them, i.e. I wasn't able to connect to my homeserver for quite a while, which also sucks.
- The ssh-based solution is secure and encrypted, in contrast to some other DDNS services, which only allow unencrypted HTTP-based connections (yes, some do allow https/SSL connections).
- This solution doesn't require in-depth DNS server config knowledge, neither does it require a DNS server you control. You only need a (non-root) ssh account on a public server (or virtual server).
- Connect to my homeserver via ssh.
- Get the homeserver's IP address so I can update my OpenVPN client config file on my laptop (I use my homeserver as OpenVPN server).
Yesterday, I again got a stupid thing like:
I spent Saturday at BarCamp Belfast. There were more people than I expected; I'm no good at judging exact numbers but the wiki lists 62. As it turned out not everyone ended up talking; this worked out well for me because I don't think I'm Web2.0 enough (is that a bit ironic given I'm writing this on a blog?). I don't really do user interfaces or website stuff and that seemed to be the primary focus of a lot of the attendees. Nice to know there's a fairly active crowd in

Yay!
Dear lazyweb: I ve been a satisfied
Ever the sucker for punishment, I decided to pick three difficult things and stick them all together: LDAP, SSL and replication. Here's how to make it go on Debian and Ubuntu.
The problem
You want LDAP replication to happen over the internet, and you want it to happen securely.
The caveat
I'm not going to tell you how to set up your LDAP from scratch here: I'm assuming you've reached a solution you're happy with and want to replicate it.
The solution
We're going to set up a replicating slave LDAP server, which communicates with the master
over the internet via an SSL-protected connection.
Enabling replication
First up, the master LDAP server needs to be configured to permit replication.
The key lines to add to your 
Some months after I got the MPAA's
Or configuring LS COLORS
After successfully 
Well I'm back and ready to do some fun work.
In the meantime it seems that at least one of my crash-fixes, from the prior public bugfixing, has been uploaded:
