Archive

Posts Tagged ‘Linux’

Dropbear SSH Server & Client

February 8th, 2009 No comments

The Dropbear SSH server and client supports industry standard SSH1 and SSH2 protocols and is available for various Linux distributions. Version 0.45 compiled for Debian PPC can be found here, this is what I have used as the SSH server for my Buffalo TeraStation.

The first step is to copy the files to the TeraStation, then extract them using the tar command

root@HD-HTGL113:/# cd /

root@HD-HTGL113:/# tar -xzf /mnt/array1/share/dropbear.tgz

The next step is optional, however in the interest of security recommended! This is to generate a new SSL public and private key for the server to use. Before we can do this the old keys need to be deleted

root@HD-HTGL113:/# rm /etc/dropbear/dropbear_rsa_host_key

root@HD-HTGL113:/# rm /etc/dropbear/dropbear_dss_host_key

root@HD-HTGL113:/# dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key

root@HD-HTGL113:/# dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key

The final step is to reboot the TeraStation, during startup the Dropbear SSH daemon will start. A recommended free SSH client to use is PuTTy

Categories: How to Tags: ,

Dynamic DNS (DYDNS) – dme_update

February 8th, 2009 No comments

Dynamic DNS is a system that allows for a DNS entry, commonly internet facing to be updated in real-time. This enables a connection to be established to a Dynamic IP Address (generally issued by an ISP) via a DNS name.

One implementation of this is DME Update which uses a simple Perl script to get the current external IP address and forms a URL which is used to update the DNS provider DNS Made Easy

My use for this has been through my Buffalo TeraStation which runs a cut down version of Linux and has the DME Update script running as a cron job. This allows me to always be able reach it without remembering an IP address.

The implementation for this is relatively simply, the requirements are:

  • wget – A well known command line HTTP retrieval program
  • Perl installed (exact version and pm files are unknown)
  • The dme_update script and config files which are here

First of all edit the config.pl file and set the $nic variable to the name of the network interface that should be doing the lookup, also set the $getip_ext variable to either 0 to use the IP address of the NIC, or 1 to use the external webpage quoted.

The next stage is to provide the DNS record details that need to be updated on DNS Made Easy, this should be placed in the records folder in a file with the following information

username
password
DNS Made Easy record ID
current record IP address

An example is:

myUsername
myPassword
1234567
22.22.22.1

To update the DNS record run the following:

perl /etc/cron.d/dyDNS/dme_update -r myRecordFile

I’m sure there are many more implementations avaliable and for many different DNS providers, however this appealed to me due to the simplicity. The end result from the Perl scirpt is a formatted URL which either updates the DNS entry if required, or does nothing. Example URL is:

http://www.dnsmadeeasy.com/servlet/updateip?username=myUsername&password=myPassword&id=1234567&ip=22.22.22.2

Categories: How to Tags: , , ,