wiki:Thumbdrive tunnel

Version 2 (modified by Dan Gastler, 10 years ago) (diff)

--

Description

The purpose of this project is to give us the ability to bring a bootable USB thumb drive to a computer and boot up a secure Linux system that we can remotely control from ohm. This is done by modifying a read-only "kubuntu install" distro so that it boots up, installs a preselected group of utilities and then calls home to ohm with an ssh tunnel.

Building the initial thumb drive

Eric?

Modification Procedure

squash fs

First we need to extract the read only part of the filesystem and make some modifications.

  • Locate the image (in /casper/filesystem.squashfs) and copy that to a local drive.
  • Go into a working directory to put the extracted filesytem
  • Run "sudo unsquashfs filesystem.squashfs" to extract the filesystem in the "squashfs-root" directory in the current path. (This MUST be done as root to assure the file permissions are correct!)
  • Now you need to set the system to auto run a local script we control. This is done through /etc/rc.local
  • The first thing we add to rc.local is the command to mount a read/write partition (labeled as WORK3.4G in this case) with the command "mount -L WORK3.4G /work"
  • Then we run a script on that newly mounted partition to do the rest of our work: "/work/startup.sh"

Example rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
mount -L WORK3.4G /work
/work/startup.sh
exit 0