freedombone(1)

NAME
freedombone - A home server configuration

SYNOPSIS
    freedombone -c [configuration file]
    -h --help Show help
       menuconfig Easy interactive installation
       menuconfig-full Full interactive installation
       menuconfig-onion Interactive installation for onion-only sites
    -c --config Installing from a configuration file
       --bbb Installing on Beaglebone Black
    -u --user User to install the system as
    -d --domain Default domain name
    -s --system System type
       --ip Static LAN IP address of the system
       --iprouter LAN IP address of the internet router
       --ddns Dynamic DNS provider domain
       --ddnsuser Dynamic DNS provider username
       --ddnspass Dynamic DNS provider password
       --microblogdomain Microblog domain name
       --wikidomain Wiki domain name
       --blogdomain Blog domain name
       --ownclouddomain Owncloud domain name
       --redmatrixdomain Redmatrix domain name
       --gitdomain Git hosting domain name
    -t --time Domain used as a TLS time source
       --ssh ssh port number
       --list Public mailing list name
       --cores Number of CPU cores
       --name Your name
       --email Your email address
       --usb Path for the USB drive (eg. /dev/sdb1)
       --cjdns Enable CJDNS
       --vpass VoIP server password
       --vport VoIP server port
       --ns1 First DNS nameserver
       --ns2 Second DNS nameserver
       --repo Debian repository

DESCRIPTION
The freedombone command provides the ability to install a complete pre-configured home server system onto any machine with a fresh installation of Debian Jessie. It was originally created for use on the Beaglebone Black SBC, but isn't limited to that particular hardware. There are a few possible variants.
  * Full install: Installs eveything
  * Mailbox: An email server with GPG encryption and mailing list
  * Cloud: Share files, maintain a calendar and collaborate on document editing
  * Social: Social networking with Red Matrix and GNU Social
  * Media: Runs media services such as DLNA to play music or videos on your devices
  * Writer: Host your blog and wiki
  * Chat: Encrypted IRC, XMPP and VoIP services for one-to-one and many-to-many chat
  * Developer: Host your own git projects with a Github-like user interface
  * Mesh: mesh network bridge to the internet
  * Nonmailbox: Installs eveything except for the email server Freedombone has more emphasis on security and privacy, and when installed on a Beaglebone Black it uses the built-in hardware random number generator as an entropy source. All communications with the box are encrypted by default using the recommendations from https://bettercrypto.org. The firewall is configured to only allow communications on the necessary ports and to drop all other packets, icmp is disabled by default, emails are stored in encrypted form using your public key and time synchronisation occurs via TLS only. Backups are also encrypted, and can be local or remote. A server system installed via the freedombone command entirely consists of free software. Non-free repositories are removed automatically upon installation. So there is no inscrutible code waiting to become a security problem.

BUILDING AN IMAGE FOR AN SBC OR VIRTUAL MACHINE
You don't have to trust images downloaded from random internet locations signed with untrusted keys. You can build one from scratch yourself, and this is the recommended procedure for maximum security. For guidance on how to build images see the manpage for the freedombone-image command. Install the freedombone commands onto your laptop/desktop:
    sudo apt-get install git build-essential dialog
    git clone https://github.com/bashrc/freedombone
    cd freedombone
    sudo make install Then install packages needed for building images:
    sudo apt-get -y install python-docutils mktorrent vmdebootstrap
    sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr
    sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu A typical use case to build an 8GB image for a Beaglebone Black is as follows. You can change the size depending upon the capacity of your microSD card.
    freedombone-image -t beaglebone -s 8G If you prefer an advanced installation with all of the options available then use:
    freedombone-image -t beaglebone -s 8G --minimal no To build a 64bit Virtualbox image:
    freedombone-image -t virtualbox-amd64 -s 8G To build a 64bit Qemu image:
    freedombone-image -t qemu-x86_64 -s 8G Other supported boards are cubieboard2, cubietruck and olinuxino-lime2.

CHECKLIST
Before installing Freedombone you will need a few things.
  * Have some domains, or subdomains, registered with a dynamic DNS service
  * System with a new installation of Debian Jessie or a downloaded/prepared disk image
  * Ethernet connection between the system and your internet router
  * That it is possible to forward ports from the internet router to the system, typically via firewall settings
  * Have ssh access to the system, typically via fbone@freedombone.local on port 2222

INSTALLATION
There are three install options: Laptop/Desktop/Netbook, SBC and Virtual Machine. On a Laptop, Netbook or Desktop machine If you have an existing system, such as an old laptop or netbook which you can leave running as a server, then install a new version of Debian Jessie onto it. During the Debian install you won't need the print server or the desktop environment, and unchecking those will reduce the attack surface. Once Debian enter the following commands:
    su
    apt-get update
    apt-get -y install git dialog build-essential
    git clone https://github.com/bashrc/freedombone
    cd freedombone
    make install
    freedombone menuconfig On a single board computer (SBC) Currently the following boards are supported:
    Beaglebone Black
    Cubieboard 2
    Cubietruck (Cubieboard 3)
    olinuxino Lime2 If there is no existing image available then you can build one from scratch. See the section above on how to do that. If an existing image is available then you can download it and check the signature with:
    gpg --verify filename.img.asc And the hash with:
    sha256sum filename.img If the image is compressed then decompress it with:
    tar -xjvf filename.tar.bz2 Then copy it to a microSD card. Depending on your system you may need an adaptor to be able to do that.
    sudo dd bs=1M if=filename.img of=/dev/sdX conv=fdatasync Where sdX is the microSD drive. You can check which drive is the microSD drive using:
    ls /dev/sd* With the drive removed and inserted. Copying to the microSD will take a while, so go and do something less boring instead. When it's complete remove it from your system and insert it into the SBC. Connect an ethernet cable between the SBC and your internet router, then connect the power cable. On the Beaglebone Black you will see some flashing LEDs, but on other SBCs there may not be any visual indication that anything is booting. With the board connected and running you can ssh into the system with:
    ssh fbone@freedombone.local -p 2222 Using the password 'freedombone'. Take a note of the new login password and then you can proceed through the installation. As a Virtual Machine Virtualbox and Qemu are supported. You can run a 64 bit Qemu image with:
    qemu-system-x86_64 -m 1G filename.img If you are using Virtualbox then add a new VM and select the Freedombone vdi image. The default login will be username 'fbone' and password 'freedombone'. Take a note of the new login password then you can proceed through the installation.

SOCIAL KEY MANAGEMENT (aka 'The Unforgettable Key')
During the install procedure you will be asked if you wish to import GPG keys. If you don't already possess GPG keys then just select "Ok" and they will be generated during the install. If you do already have GPG keys then there are a few possibilities You have the gnupg keyring on an encrypted USB drive If you previously made a master keydrive containing the full keyring (the .gnupg directory). This is the most straightforward case, but not as secure as splitting the key into fragments. You have a number of key fragments on USB drives retrieved from friends If you previously made some USB drives containing key fragments then retrieve them from your friends and plug them in one after the other. After the last drive has been read then remove it and just select "Ok". The system will then try to reconstruct the key. For this to work you will need to have previously made three or more Keydrives. You can specify some ssh login details for friends servers containing key fragments Enter three or more sets of login details and the installer will try to retrieve key fragments and then assemble them into the full key. This only works if you previously were using remote backups and had social key management enabled.

FINAL SETUP
Any manual post-installation setup instructions or passwords can be found in /home/username/README. You should remove any passwords from that file and store them within a password manager such as KeepassX. On your internet router, typically under firewall settings, open the following ports and forward them to your server.
    | Service | Ports |
    |---------+------------|
    | HTTP | 80 |
    | HTTPS | 443 |
    | SSH | 2222 |
    | DLNA | 1900 |
    | DLNA | 8200 |
    | XMPP | 5222..5223 |
    | XMPP | 5269 |
    | XMPP | 5280..5281 |
    | IRC | 6697 |
    | Git | 9418 |
    | Email | 25 |
    | Email | 587 |
    | Email | 465 |
    | Email | 993 |
    | VoIP | 64738 |
    | Tox | 33445 |
    | IPFS | 4001 |

KEYDRIVES
After installing for the first time it's a good idea to create some keydrives. These will store your gpg key so that if all else fails you will still be able to restore from backup. There are two ways to do this: Master Keydrive This is the traditional security model in which you carry your full keyring on an encrypted USB drive. To make a master keydrive first format a USB drive as a LUKS encrypted drive. In Ubuntu this can be done from the Disk Utility application. Then plug it into the Freedombone system, then from your local machine run:
    ssh myusername@mydomainname -p 2222
    sudo control Select Backup and Restore then Backup GPG key to USB (master keydrive). Fragment keydrives This breaks your GPG key into a number of fragments and randomly selects one to add to the USB drive. First format a USB drive as a LUKS encrypted drive. In Ubuntu this can be done from the Disk Utility application. Plug it into the Freedombone system then from your local machine run the following commands:
    ssh myusername@mydomainname -p 2222
    sudo control Select Backup and Restore then Backup GPG key to USB (fragment keydrive). Fragments are randomly assigned and so you will need at least three or four keydrives to have enough fragments to reconstruct your original key in a worst case scenario. You can store fragments for different Freedombone systems on the same encrypted USB drive, so you can help to ensure that your friends can also recover their systems. This might be called the web of backups or the web of encryption . Since you can only write a single key fragment from your Freedombone system to a given USB drive each friend doesn't have enough information to decrypt your backups or steal your identity, even if they turn evil. This is based on the assumption that it may be difficult to get three or more friends to conspire against you all at once.

AUDIT
Since this is a server system which will be connected to the internet - and therefore subjected to all of the potential hazards which that entails - it's important to be able to check what the system does and that it doesn't contain any antifeatures or "implants". The freedombone command isn't actually a binary. It's just a bash script. So by loading /usr/local/bin/freedombone into a text editor you can check what gets installed and in what sequence and whether you think the encryption settings or the firewall or the configuration is as good as it could be. You can do the same with other freedombone commands within /usr/local/bin. There is no secret source.

PASSWORDS
Passwords for server applications are randomly generated and can be found within /home/username/README after the system has fully installed. You should move those passwords into a password manager, such as KeepassX.

ADMINISTERING THE SYSTEM
To administer the system after installation log in via ssh, become the root user and then launch the control panel.
    ssh fbone@freedombone.local -p 2222
    sudo control From there you will be able to perform various tasks, such as backups, adding and removing users and so on. You can also do this via commands, which are typically installed as /usr/local/bin/freedombone* and the corresponding manpages.

BUGS
Report bugs at https://github.com/bashrc/freedombone/issues

AUTHOR
Bob Mottram <bob@robotics.uk.to>
PGP/GPG: EA982E38
Bitmessage: BM-2cWuhmBvVdfrHhLoZTdspCkKeiTorUesSL
Web: http://robotics.uk.to