Family server setup

April 1st, 2008 § 4


Introduction:
I’ve had a home-built server sitting in my flat for a while now but have never got round to setting it up as much more than a personal networked storage device.
I was then hit by some very strange memory/motherboard problems which cropped up during my exams, so it’s taken me a while to get things up and running again.
Anyway, after a few days (I’m slow and learning) I have a pretty useful family backup server which, touch wood, is running very very well.

Requirements:

  • 5 laptops (1 roaming around Europe, 2 at University and 2 at my parents’ house)
  • 4 with Windows XP and 1 with Vista; 2 on a home network, 1 (w/ Vista) usually behind a corporate firewall and 2 on University networks with their rather restrictive firewalls
  • Invisible backup to the server from any location on a regular schedule
  • Ability to remotely administer each client or provide tech support (a common occurrence)
  • SSH tunnel to a Squid proxy to allow secure surfing on suspect WiFi networks by all computers
  • Some useful ‘local’ applications for backing up media from my own desktop
  • Solution:

    The Server – Hardware
    Gigabyte GA-MA770-DS3 AMD 770 motherboard w/ Athlon 64 3Ghz and 1Gb of RAM
    2 x WD Caviar IDE 320Gb drives
    2 x WD Caviar Black SATA 640GB drives
    1 x Netgear Gigabit switch to speed up transfers from my desktop to the server
    …and all the other hardware essentials.

    The Server – Software
    Ubuntu 8.10 LAMP server w/ various additions & modifications, including:
    Webmin
    Torrentflux
    SAMBA
    Hamachi
    rsync
    uShare
    Squid (Details coming soon)

    The Clients
    Hamachi VPN installed on each, all connected to one network with an extremely strong password
    SyncBack installed on each, with schedules set up, frequently for critical folders (essays, presentations etc) and less frequently for bulk folders (music, videos, photos)
    LogMeIn Free installed on each and linked to my LogMeIn ITReach account

    The Software:

    SAMBA

    User-specific SAMBA shares for each user/client, meaning each client only has access to their own backup folder, whilst I have access to all folders.
    I also have a drop-box type SAMBA share in which anyone can save any kind of file, which is useful for sharing photos, lists etc when email won’t do.

    As an aside, I found this quite tricky to set up and am happy to share my .conf file with anyone who needs it. I set up users on the server matching each client that would be connecting to SAMBA, making sure the passwords exactly matched. (The current setup means that when a client updates its password, I need to manually update each SAMBA password. With a small number of users, this isn’t too difficult).

    I have included the main steps below:

    Install SAMBA:

    sudo apt-get install samba smbfs

    Edit the configuration file:


    sudo nano /etc/samba/smb.conf

    Find “netbios name” and replace YOUR_HOSTNAME with whatever you chose on installation (e.g. UBUNTU)

    Find “workgroup” and replace YOUR_WORKGROUP with the name of the workgroup configured in Windows
    (To find out the Workgroup name in Windows:
    - Right click on “My Computer”
    - Click the 2nd Tab entitled “Computer Name” and find the name of the Workgroup)

    Find this section:


    ####### Authentication #######
    # "security = user" is always a good idea. This will require a Unix account
    # in this server for every user accessing the server. See
    # /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
    # in the samba-doc package for details.
    ; security = user

    Uncomment the security line and make it look like this:


    security = user
    username map = /etc/samba/smbusers

    This configures SAMBA to use the smbusers file for looking up users.

    Create a SAMBA user:


    sudo smbpasswd -a username

    Add that user to the smbusers file (1):


    sudo nano /etc/samba/smbusers

    Add that user to the smbusers file (2):


    username = "username"

    Now you can create SAMBA shares by either using Webmin or editing “/etc/samba/smb.conf” as above.

    While the file looks complicated because it is extensively commented, each share at the bottom of the file really just looks like this:

    [User1-laptop]
    comment = User 1's Laptop Backup
    path = /media/disk1/user1-laptop
    browseable = yes
    read only = no
    valid users = user1 greg

    Replace User1 with the username of each client, repeat for each client and make sure you are also added as a valid user.

    Once you’re done, run “testparm” to check you have no errors in the conf file. Once that’s fine, run:


    /etc/rc.d/rc.samba restart

    Should you run into any problems, the Ubuntu forums are your saviour and if you’re still stuck, try the SAMBA HowTo documentation. A very good HowTo can be found here.

    Installing Hamachi on the Ubuntu server is far from zero-config but a careful reading of the forums soon sorts out various problems with upx-ucl-beta and other unexpected steps. As above, I am happy to share my solutions but this page from the Hamachi Wiki should be all you need.

    I have added uShare to serve up my videos to the XBox 360 via UPnP, plus HandBrake CLI so I can backup my (legally bought) DVDs straight to a chosen format on the server.
    To round off the media backup tools, I added automated CD backups to MP3 using ABCDE.

    Despite the impressive up-time of Google’s Gmail, I am happier having a local backup of my Gmail account. Following this tutorial I installed Getmail and now have a .mbox file on the server updated daily.

    When I am away from home, access to the server is relatively straightforward. Using Putty, I create a local SOCKS proxy and connect to the server’s address (maintained using DynDNS) over port 443, which is rarely blocked by any corporate or personal firewalls. Then, it’s a simple matter of configuring Firefox to use the local proxy (127.0.0.1:PORT#) to send all traffic and DNS requests through the SSH tunnel to the server.
    Crucially, this also allows me to browse Webmin, Torrentflux, uShare and other web interfaces directly from my browser, wherever I am. As the server is running Hamachi, I can also address each client using it’s Hamachi IP address (5.*.*.*).

    I have made use of secure features on the dd-wrt firmware to allow me to use an SSH tunnel to the server for when I’m stuck behind a restrictive firewall, therefore translating the port 443 incoming traffic to the correct SSH port for forwarding on to the server.

    The Result:

    • Each computer backs up to the server on a staggered schedule with SyncBack, via Hamachi. I have a central repository for all family photos, all my music plus an accessible backup from which to restore files should anything happen.
    • I have a way of browsing the internet securely when using an unsecured WiFi connection when ‘roaming’.
    • Each client can choose to use a Squid proxy running on the server when browsing on an unsecure network as the server has an Hamachi address (5.*.*.*) and so appears as a local computer to each client. I recommend FoxyProxy for easy selection of proxies.

    I picked up a special offer on LogMeIn ITReach a few months ago and find it invaluable for synchronizing my network drive and my files on my home desktop, although I cannot connect to the server using this method, instead using Putty and the DynDNS address. LogMeIn Free is far more limited in terms of features but is fine for simple tech support purposes.
    Overall, I’ve been extremely impressed with LogMeIn, especially the security offered. For example, as well as an account login and password (plus the remote computer’s credentials) I am sent a one-time 8 digit
    key to my email (and therefore my Blackberry) each time I log in.

    As an aside, I’ve recently started using the wonderful DropBox and now instead of carrying a USB stick with my PortableApps suite on it, I have all my portable programs (including Firefox 3) in the DropBox folder. If I’m on a computer which allows me to install DropBox, great. Otherwise, I can simply download a Zip file of Portable Firefox to use temporarily.

    Please leave a comment if you’ve found this useful or would like any help with what I’ve done.

    To Do:

    Code snippets for Hamachi installation
    Putty setup screenshots/links

    § 4 Responses to “Family server setup”

    What's this?

    You are currently reading Family server setup at gregnbaker.com.

    meta