0

I wanted to encrypt a directory in such a way that the directory will stay encrypted after I login and only when I deliberately enter my passphase will the content of the directory be decrypted. I did the following

mkdir ./secret
chmod 700 secret
sudo mount -t ecryptfs ./secret ./secret

Answered all the questions with sensible answers and check with

>mount |grep secret
/home/myname/mydir/secret on /home/myname/mydir/secret type ecryptfs (rw,relatime,ecryptfs_fnek_sig=xxxxxx,ecryptfs_sig=yyyyyy,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs)

and then placed some files into ./secret , checked the files are accessible (which is suppose to be). Then I unmount the directory so that it stays encrypted.

sudo umount ./secret

Checked again now all the files are encrypted (also filenames). Then I want to access the files I tried to mount it back using the following line

sudo mount ./secret ./secret -o key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=yes

But I got a

mount: /home/myname/mydir/secret: /home/myname/mydir/secret is not a block device.

Did I missing something when first setup the mount point?

closed as off-topic by Jeff Schaller, Stephen Kitt, Stephen Rauch, G-Man, Rui F Ribeiro Dec 4 '17 at 9:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, Stephen Kitt, Stephen Rauch, G-Man, Rui F Ribeiro
If this question can be reworded to fit the rules in the help center, please edit the question.

  • You mounted it on top of itself... that's rather confusing, especially for testing – Xen2050 Nov 29 '17 at 9:04
1

OK after studying a bit I realized for my case I need to specify the -t ecryptfs again in my mount command:

sudo mount -t ecryptfs ./secret ./secret -o key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=yes

And then it worked.

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