Encrypted Backup Solution "Home Paranoia Edition"
The next step is to select your preferred filesystem type (ext3, ext4 and so on). Once the volume-creating process is completed, mount your volume using the TrueCrypt application and start saving your private files to this encrypted container.
Figure 9. Select the newly created standard volume to mount an accessible unencrypted share.
The company also provides two-factor authentication for extra protection of requiring a user name, password and a token. The token will be sent to your mobile phone whenever you need to log in to a Web site or mobile device. The majority of big-name providers are offering two-factor authentication since the traditional password/passphrase does not offer enough protection. Seeing how this solution is deployed on a dedicated desktop and requires the token to authenticate, it provides a true two-channel authentication solution. Of course, using two-factor authentication does not guarantee safety, but it does require the attacker to use sophisticated methods, and attackers generally are lazy and look for easy targets.
Installing SpiderOak is straightforward for all the Debian
users out there. It includes downloading and installing the
spideroak_4.8.4_i386.deb package from
https://spideroak.com/opendownload and using
sudo dpkg -i
spideroak_4.8.4_i386.deb to install this package on your favorite Ubuntu
Identify a local upload folder as the staging point for your TrueCrypt container. Once you have a shared location that will host your TrueCrypt container, simply open your SpiderOak application and select the backup tab. Then, drill down until you find your TrueCrypt container location, such as home/username/SpiderO/Upload.
The next step is to configure your backup frequency using the overview tab and selecting the change button (Figures 10 and 11).
Figure 10. The backup tab in the SpiderOak application allows you to select your encrypted volume.
Figure 11. A SpiderOak application status and backup menu provides a means to back up your encrypted volume automatically in specified intervals.
Many other configuration options are available using this interface. For this example, use only these two options for a secure cloud backup.
The last couple steps in this encrypted backup solution are to move the TrueCrypt container from the working location to the designated SpiderOak export folder and create a cron job to run the script.
I created a Python script to accomplish the copy function, but I could have created any type of script. This script is used to ensure that the TrueCrypt application is not running, verify whether there were changes to the container and then copy over the container if there were changes. This script requires a configuration file called FolderandFileLoc to function and the Python script BackupScript.py. The configuration file parameters are SpiderOakPath, TrueCryptPath and LogFilepath, a running log to verify whether a copy was successful and the Safefile filename.
Listing 1. SpiderOak/TrueCrypt Backup Script
#!/usr/bin/python ''' SpiderOak, TrueCrypt, dis-mount, Backup Script @author: Tim ''' import os import string import datetime import hashlib FolderandFileLoc = "FolderandFileLoc" SpiderOakPath = " " TrueCryptPath = " " LogFilepath = " " safefile = " " def readconfigfile(SpiderOakPath,TrueCryptPath,LogFilepath,safefile, ↪Setupfileopen): # This will read the configuration and assign path location now = datetime.datetime.now() holdstr = "" for line in Setupfileopen: holdstr = str.split(line) if string.find(line,"SpiderOakPath") > -1: SpiderOakPath = holdstr elif string.find(line,"TrueCryptPath") > - 1: TrueCryptPath = holdstr elif string.find(line, "LogFilepath") > -1: LogFilepath = holdstr elif string.find(line,"safefile") > -1: safefile = holdstr fo = open(LogFilepath,"a") try: fo = open(LogFilepath,"a") fo.write (str(now) + "- Path Variable SpiderOakPath ↪used -> " + SpiderOakPath + "\n") fo.write (str(now) + "- Path Variable TrueCryptPath ↪used -> " + TrueCryptPath + "\n") fo.write (str(now) + "- Path Variable LogFilepath ↪used -> " + LogFilepath + "\n") fo.write (str(now) + "- Path Variable hold ↪used -> " + safefile + "\n") except: fo.error shutdowntruecrypt(fo,now) copycontainer(fo,SpiderOakPath,TrueCryptPath, ↪LogFilepath,safefile,now) fo.close def shutdowntruecrypt(fo,now): # Test to see if the truecypt is running # If not then Shut it down foundstring = 0 try: f = os.popen( "ps ax" ) except: os.error for line in f: if string.find(line, 'truecrypt') > -1: foundstring = 1 break if foundstring == 1: try: dismount = os.system("truecrypt -d") if dismount == 0: fo.write (str(now) + "- True Crypt0service found ↪and the volume is dis-mounted \n"); else: fo.write (str(now) + "- Failed to ↪dismount service \n "); except: os.error else: fo.write (str(now) + "- mount was not open \n "); def copycontainer(fo,SpiderOakPath,TrueCryptPath, ↪LogFilepath,safefile,now): #Set Destination and Copy to new location Holddestfilesum = TrueCryptPath + safefile Holdorigfilesum = SpiderOakPath + "/" + safefile checksumdest = md5filecheck(Holddestfilesum) checksumorig = md5filecheck(Holdorigfilesum) runstring = "cp " # This will only copy over updates # to this file runstring += TrueCryptPath runstring += safefile runstring += " " runstring += SpiderOakPath # This will only send over any # updates to this file testdiff = os.system("diff " + Holddestfilesum + " ↪" + Holdorigfilesum) if testdiff !=0: try: os.system(runstring) testdiff = os.system("diff " + Holddestfilesum + " ↪" + Holdorigfilesum) if testdiff != 0 : fo.write (str(now) + TrueCryptPath + safefile + ↪" File Copied to " + SpiderOakPath + "\n") fo.write(str(now) + " ---- Processing Complete ----") else: fo.write(str(now) + TrueCryptPath + safefile + ↪"File failed to copy " + SpiderOakPath + "\n") except: os.error else: fo.write (str(now) + " File has not been changed ↪no copy was performed\n") Setupfileopen = open(FolderandFileLoc,"r") readconfigfile(SpiderOakPath,TrueCryptPath,LogFilepath,safefile, ↪Setupfileopen) Setupfileopen.close()
The final step is to create a cron job to call the Python script:
0 5 * * * cd /home/t/workspace/BackupScript/src; /usr/bin/python /home/t/workspace/BackupScript/src/BackupScript.py
This personal encrypted solution is something that works great at home when utilized on a daily basis. Many apps are available on the Internet for managing passwords and data, but this one is easy to implement and provides layers of encryption. I am confident that using the described encrypted containers and storage location provides enough security for private personal data, but it may not be an ideal solution for an enterprise with various regulatory agencies. Use the described methods at your own risk, and ensure that your passwords or passphrases are safeguarded, because your data will be lost with a forgotten password.
Tim Cordova is a computer geek who had a Commodore 64 at age 9, and has a love for Linux, family, information security and longboard surfing.
Practical Task Scheduling Deployment
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.View Now!
|The Firebird Project's Firebird Relational Database||Jul 29, 2016|
|Stunnel Security for Oracle||Jul 28, 2016|
|SUSE LLC's SUSE Manager||Jul 21, 2016|
|My +1 Sword of Productivity||Jul 20, 2016|
|Non-Linux FOSS: Caffeine!||Jul 19, 2016|
|Murat Yener and Onur Dundar's Expert Android Studio (Wrox)||Jul 18, 2016|
- Stunnel Security for Oracle
- The Firebird Project's Firebird Relational Database
- SUSE LLC's SUSE Manager
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Managing Linux Using Puppet
- My +1 Sword of Productivity
- Non-Linux FOSS: Caffeine!
- Google's SwiftShader Released
- SuperTuxKart 0.9.2 Released
- Doing for User Space What We Did for Kernel Space