2

I was able to fix this by using the encfs -S option, this pulls the password from a file instead of prompting for the password every time the script is run.

This is not very secure as the password is in plaintext within the file, but right now it solves my problems.

I will continue looking for a more secure solution.


I am using an encrypted amazon cloud drive as a source drive for using the same files on many different machines. I have it mounted on several Ubuntu machine and everything works fine, but in order to update the local cache it needs to be unmounted.

These machines only read from the cloud, the source material is uploaded via another machine.

I need some help making a cron task or script that will run every hour and first unmount the encrypted fs, update the local cache, remount the cloud and remount the encfs on top using.

When I use encfs from the command line, I use a xml encryption file and then it prompts for the master password.

ENVIRONMENT VARIABLES ENCFS6_CONFIG Which config file (typically named .encfs6.xml) to use. By default, the config file is read from the encrypted directory. Using this option allows to store the config file separated from the encrypted files.

     Warning: If you lose the config file, the encrypted file contents
     are irrecoverably lost. It contains the master key encrypted with
     your password. Without the master key, recovery is impossible, even
     if you know the password.

I use the following commands to unmount the cloud and encfs:

/bin/fusermount -u /home/user/.cloud 
/bin/fusermount -u /home/user/cloud

Then update the local cache using the following command:

/usr/local/bin/acd_cli s 

Then mount the cloud storage again:

/usr/local/bin/acd_cliacd_cli mount --modules="subdir,subdir=/Ww4hiiFIGcL50MEsUcd2NI4e" /home/user/.cloud

Then setup the decryption:

ENCFS6_CONFIG='/home/user/1.Important.files/.encfs6.xml' encfs /home/user/.cloud /home/user/cloud

The problem I have is that the last command asks for a password to be entered, is there anyway of making it read the password from a file or worst case scenario, hard code the password in the script.

Pilot6
  • 88,764
  • 91
  • 205
  • 313
English_Man
  • 165
  • 1
  • 3
  • 8
  • You can add scripts to cron without a password. Cron runs as root. – Pilot6 Mar 19 '16 at 11:47
  • It's not the root password it asks for, its the master password to the encrypted files. For the encfs xml file. – English_Man Mar 19 '16 at 12:02
  • 4
    If you have a solution, please post it as an answer. Don't add it to the question, don't change the title to include "solved". – muru Mar 19 '16 at 15:15

0 Answers0