Tuesday, 3 January 2012

Further adventures with OpenBSD - Encrypting Files systems

So I decided to create an encrypted folder on my workstation to use as a storage device for work related files (which typically have passwords etc located in them). After some trial and error I found the way to do it. Blog entries and the like that reference this material mention using the svnd0 vnode device for the encryption but it doesn't work. I'm not sure if this is an OpenBSD 5 peculiarity or something to do with my Sparc install but I eventually sorted it out.

Note: do all commands as the root user - it's a lot easier.

I created the sparse file to be encrypted:
    # dd if=/dev/zero of=/location/of/secret/file/.cryptfile bs=1024 count=1024000

Note that it's 1GB in size and has a preceeding "." so it's at least a little bit hidden from a casual ls search.

I have to mount .cryptfile somewhere so I created a folder for that too:

    # mkdir /media/crypt (or wherever you'd like to put it)

I have to check what vnodes are available:

    # vnconfig -l
vnd0: not in use
vnd1: not in use
vnd2: not in use
vnd3: not in use

I can choose any of these to associate with my virtual encrypted device. I will use vnd0. Using vnconfig again:

    # sudo vnconfig -ck -v vnd0 .cryptfile
Encryption key: (use something good)
vnd0: 1048576000 bytes on .cryptfile

OK so now we need to create a file system on our device (which is only a single partition) so we need to newfs the "c" slice as this is the whole disk:

    #  sudo newfs /dev/vnd0c
/dev/rvnd0c: 1000.0MB in 2048000 sectors of 512 bytes
5 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
super-block backups (for fsck -b #) at:
 32, 414688, 829344, 1244000, 1658656,

So now to mount our encrypted filesystem to store our secret files!

    # mount /dev/vnd0c /media/crypt

Probably a good idea to make it usable for me:

    # chown -R angus:wheel /media/crypt

And we're off and racing:

# df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/wd0a     1005M   42.2M    913M     4%    /
/dev/wd0k     42.8G    1.0G   39.7G     2%    /home
/dev/wd0d      3.9G    224K    3.7G     0%    /tmp
/dev/wd0f      2.0G    450M    1.4G    24%    /usr
/dev/wd0g     1005M    135M    820M    14%    /usr/X11R6
/dev/wd0h      8.6G    1.9G    6.3G    23%    /usr/local
/dev/wd0j      2.0G    2.0K    1.9G     0%    /usr/obj
/dev/wd0i      2.0G    2.0K    1.9G     0%    /usr/src
/dev/wd0e      7.9G   42.7M    7.4G     1%    /var
/dev/vnd0c     984M    2.0K    935M     0%    /media/crypt

I'll be re-creating this whole thing again soon so watch out for any updates or errata.

Check out: 
http://www.backwatcher.org/writing/howtos/obsd-encrypted-filesystem.html for some handy mounting/unmounting scripts.

FreeNAS Upgrade from i386 to x64

To get reporting working properly do the following:

SSH to the box (or use the console)

[root@freenas] ~# service collectd stop
    Stopping collectd.
    Waiting for PIDS: 4002.
[root@freenas] ~# find /data -name "*.rrd" -exec rm -rf {} \;
[root@freenas] ~# find /var/db/collectd -name "*.rrd" -exec rm -rf {} \;
[root@freenas] ~# service collectd start
    Starting collectd.

... and reporting will be fixed.

FreeNAS version is FreeNAS-8.0.2-RELEASE-amd64 (8288)

*BSD vs Linux for Home Server

I have a few simple needs for my home server - it needs to be stable, functional on older hardware (P4 2GHz with 1 or 2 GB of RAM) and run a few simple applications:
  • rtorrent (for... ahem... legitimate torrent requirements)
  • irssi - the bestest IRC client (and the one I've spent ages getting a nice config file for)
  • screen (for teh awesomeness!)
  • SSH - for remote work, and for sshfs so I can rsync and backup data remotely
  • and a bit of storage space - 100GB is nice
  • nagios - monitoring work sites as required
  • DHCP
  • DNS
Currently I'm running Ubuntu 10.04.3 LTS on a P4 3GHz USDT HP that has a noisy fan in it and I'm going to migrate back to my Dell P4 2GHz box that I was running before. It has a slower processor, is quiet and reliable. It's also more power efficient than the current one. I've been considering getting my hands on an Atom powered box or the like with very low power requirements for home. After all this server really doesn't have to do a lot or work - it just needs to chug quietly away and provide the basic services I need. So why change?

Well several reasons I guess. Security is the big one. Reliability is the next one. A rolling distribution would be handy too - one with easy, in place, headless upgrades.

Most Linux variants will support the apps I listed, as will FreeBSD and DragonFly BSD, my two preferred BSD variants (even though I've had great success with OpenBSD on my Sun Blade - see earlier posts). I'm thinking FreeBSD may be the option to go with, so I'm playing with it under VMware Player at the moment. DragonFly's HAMMER files system is mighty attractive though, so I'm thinking very carefully about this choice. I'll keep notes on my adventure as it goes forward.

Monday, 23 May 2011

HTC Aria Review

After the unmitigated disaster that is the Motorola Backflip I have very fortunately managed to get my hands on the HTC Aria. Although this device is aimed at a mid market it's a wonderful little bit of kit. OK so first up the hardware.

The device itself is quite compact and fits in the palm with ease. I find that I can put it in the same case I had my e66 in without worry and it fits easily. The screen takes up the majority of the Aria with 4 capacitive buttons and a swipe mouse thing as well. Only a few external buttons - volume up/down and the lock/on/off switch. Under the black casing is a brightly coloured interior which is quite striking. The screen itself, which I read elsewhere as being not as bright as the OLED type screens is nonetheless bright and readable. I find it better than my iPhone 3GS to read. The keyboard works relatively well and the device is easy to use.

The built in HTC themes and widgets are superb and I've found that I don't need to add any extra widgets for a lot of the stuff I used on the Motorola.

Friday, 3 December 2010

DG834 resolved - v5 is where it's at

After much wrangling, I didn't get the Netcomm to work properly, the VPN was still no good and I was unable to get VOIP running across it. Fortunately I ran into an old buddy and he suggested using the v5 of the Netgear router. Lo and behold, it uses a Conexant chipset, not Broadcomm and I put two in, one at either end. Both have been very stable, no dropouts and the VPN works perfectly.

Following this small victory I then deployed one at home and it's working fantastically well. I've been hammering it too so it's all going along nicely and my VPN is working properly too.

While the Netcomm is undoubtedly a powerful device, the lack of configuration in the VPN side of things and the fact it won't send VOIP data properly are big strikes against it. I've redeployed one of these routers elsewhere and the user loves it so that's a win and no financial loss on my part.

The love affair with Netgear is renewed!

Things I'd like to see on the iPhone

The number one thing I'd like to see on the iPhone is to be able to turn push mail on and off according to time automatically. My venerable e66 had this - it would check my mail faithfully throughout the day between 8am and 6pm and then stop. It did wonders for the battery life and for my sleep patterns. If I inadvertantly forget to disable this when I go to bed, nagios wakes me up as it's monitoring failing servers or systems.

In fact, the ability to have auto on/off dependent on time is something that the iPhone could apply to a bunch more things too - like changes of ringtones etc. It's probably too hard to do for Apple so as my old dad says - wish in one hand and pee in the other and see which hand fills up the quickest!

The other thing I'd like is for a slightly more robust design, but hey - you can't have everything. My Motorola Backflip (MB300) is more rugged and seems to go pretty well.

Tuesday, 23 November 2010

Netcomm NB8WVPN and the Netgear DG834

After the woes I've experienced with the DG834 I cast about looking for a replacement device. It needed to be a decent ADSL 2+ router (with built in modem) and support site-to-site VPN tunnels - none of this VPN pass through garbage. After looking around a bit, I found the NB8WVPN from Netcomm which promises all sorts of things about how wonderful it is etc etc. So I purchased two and set them up at one of my problem sites - both ends. Now each of these sites has an Alcatel-Lucent phone system that use a VOIP link to put calls through to each other. Naturally this VOIP link has to go across a VPN.

With the VPN established between the two sites, I had some connectivity between them - that is, I could ping and browse the network etc but the phone systems couldn't talk to one another. The initial part of the VOIP signalling goes through, but the call itself doesn't. Remarkably frustrating I must say. After alterations to the phone systems (and I must add: the VOIP worked perfectly over the Netgear VPN) we got partial signalling through.

Eventually I put the stable Netgear back in and here's where it gets tricky. When I created the VPN between the NB8WVPN and the DG834 I had to make it quite basic. No Perfect Security or anything like that. Also, in the Advanced settings on the NB8, I had to change the settings to SHA-1 from it's original setting. Once this was all done I got a VPN back up! Yay! Before I performed jumps of joy, I tested it with my trusty sidekick. He could call me (from the Netgear side) but couldn't hear me and I couldn't call him from the NB8 side. The support on this is very sketchy out there. I was surprised by how little there is about these routers out there. I eventually upgraded the firmware on the NB8 and it's nearly time to test.

The good thing out of all this is, that the VPN was able to carry data like pings (ICMP) NetBIOS queries and various TCP streams like HTTP. It just doesn't seem to like the VOIP signalling. Additionally I found it very useful to disable the QoS on the Netcomm's. I tested the VOIP signalling by using two Linux notebooks with extra NIC's bridged and running Wireshark to see what was happening. I now need to go back to site and test it all.

Omarchy - the new darling of the Linux world

 Omarchy is the buzzword at the moment, with it turning up on Network Chuck's YouTube channel. I came across it via DHH's blog post ...