Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an ecryptfs "Private" folder in my home directory, and it is set up to automatically mount whenever I log in. I want to set up automatic backups to a network drive, but I don't want the contents of Private to be readable on the remote server. My understanding is that the Ubuntu "Backup" utility would run while I'm logged in, so it would see the folder contents without encryption. I'm backing up from a laptop, so it is essentially only on when I am logged in.

I know that the Private folder is essentially a mounted filesystem, so it seems like I should be able to backup the encrypted image rather than the cleartext contents.

What steps are needed to safely back it up, while maintaining the encryption? Note that I'm already familiar with the backup tools available, this question is about dealing with the ecryptfs folder safely.

share|improve this question
Wouldn't this be horribly inefficient? If you change anything in the encrypted folder, do you have to back it up in it's entirety each time? I am using @Uli's answer here to back up individual encrypted files with encfs, and it works very well. Maybe an adaptation of that answer would work best here? – Tom Brossman Aug 25 '12 at 21:16
@TomBrossman no, it is pretty efficient. The files are individually encrypted. – nealmcb May 18 '15 at 17:12
  • Logout from graphical desktop
  • switch to text mode using CTRL-ALT-F1
  • login as a different user with rights to access the encrypted files
  • copy contents of the encrypted file folder to your network drive. I would recommend writing a short shell script which copies the files using rsync
  • verify that you can mount and access the encrypted backup files


share|improve this answer
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – RolandiXor Aug 27 '12 at 14:20
up vote 3 down vote accepted

As it turns out, the .Private filesystem is ecryptfs, which contains a separate encrypted file for each item.

My solution is to backup the contents of ~/.Private (even though it is mounted at the time). The backup process should handle any changes in that folder gracefully since they are individual files.

share|improve this answer
Cool, good to know. – Tom Brossman Aug 29 '12 at 16:04
Yes, this works well for me also. I just use rsnapshot, which backs up ~/.Private (assuming you back up your home directory), and doesn't back up ~/Private unless you explicitly ask for that (which you shouldn't do!) See the instructions in @floyd's answer for how to confirm you can decrypt them (and practice!). See Bug #455709 ""mounting eCryptfs: -2 No such file or directory”... : Bugs : ecryptfs-utils package : Ubuntu to see why a standard sudo mount -t ecryptfs .Private /mnt/private doesn't work in Ubuntu. – nealmcb May 18 '15 at 17:18

You can use duplicity

  • Securely gpg encrypted
  • Supports ssh, ftp, webdav, amazon s3
  • uses rsync (only changed files are sent in future backups)

Déjà Dup is a GUI frontend for duplicity. Make sure to check Encrypt backup files.

share|improve this answer

You can use minio client aka mc

  • Supports amazon S3 & Google Cloud Storage
  • Written in Golang
  • Apache License v2.0
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.