← Back to team overview

ecryptfs-users team mailing list archive

Re: Creating an encrypted directory -- cannot umount

 

* Tyler Hicks <tyhicks@xxxxxxxxxxxxxxxxxx> [110127 22:02]:
> On Thu Jan 27, 2011 at 09:49:58PM -0800, John Magolske <listmail@xxxxxxx> wrote:
> > * Tyler Hicks <tyhicks@xxxxxxxxxxxxxxxxxx> [110127 21:21]:
> > > On Thu Jan 27, 2011 at 07:37:05PM -0800, John Magolske <listmail@xxxxxxx> wrote:
> > > > I'm trying to create an encrypted directory 
> > > > [...]
> > > >   % mkdir .crypto-dir
> > > >   % chmod 700 .crypto-dir
> > > >   # aptitude install ecryptfs-utils
> > > >   # modprobe ecryptfs
> > > >   # mount -t ecryptfs .crypto-dir .crypto-dir
> > > >   Passphrase:
> > > >   [...]
> > > > Then I cd'd into ~/.crypto-dir (as non-root) and created some
> > > > files there. But when I try to umount, I'm getting this:
> > > > 
> > > >   # umount .crypto-dir
> > > >   /sbin/umount.ecryptfs: symbol lookup error: /sbin/umount.ecryptfs:
> > > >   undefined symbol: ecryptfs_remove_auth_tok_from_keyring
> > > >   /sbin/umount.ecryptfs: symbol lookup error: /sbin/umount.ecryptfs:
> > > >   undefined symbol: ecryptfs_remove_auth_tok_from_keyring
> > > [...]
> > >
> > > If you're just wanting umount to work without warnings/errors,
> > > `umount -i .crypto-dir` will work until we figure this out. That will
> > > bypass the eCryptfs umount helper and will just perform the unmount.
> > > 
> > > Note that the eCryptfs umount helper is what removes your mount key
> > > from the kernel keyring. So, if you don't want the key to hang around,
> > > you'll need to do something like `keyctl clear @u` after umount with
> > > the -i flag.
> > 
> > Excellent, this does the job for now. Next, to wrap up
> > `mount -t ecryptfs -o key= ...` in a shell script that queries
> > me for the passphrase.
> 
> You can also perform a mount, look at the mount options in
> /proc/mounts, use those arguments to create an entry in /etc/fstab, and
> add the user option. Then, you'll just need to do the following:
> 
> $ ecryptfs-add-passphrase
> $ mount -i ~/.crypto-dir
> 
> You'll be able to do those 2 commands as a regular user and will no
> longer have to switch to root for the mount.

I put the arguments found in /proc/mounts (plus the user option) into
an entry in /etc/fstab, now the `mount -i ~/.crypto-dir` and
`umount -i .crypto-dir` commands will mount & umount the directory
without a hitch. But this only works as root, as non-root I get:

  $ mount -i /home/john/.crypto-dir
  mount: No such file or directory

then after successfully applying the above command as root:

  $ umount -i /home/john/.crypto-dir
  umount: only root can unmount /home/john/.crypto-dir from /home/john/.crypto-dir

Also, if I do `keyctl clear @u` after a `umount -i .crypto-dir`, when I
try `mount -i ~/.crypto-dir` I get "mount: No such file or directory".
I can go back & manually do `mount -t ecryptfs .crypto-dir .crypto-dir`
and that mounts the directory again.

And when I try `ecryptfs-add-passphrase` at any point, there is this:

  ecryptfs-add-passphrase: symbol lookup error: ecryptfs-add-passphrase: undefined symbol: ecryptfs_get_passphrase

Regards,

John


-- 
John Magolske
http://B79.net/contact



Follow ups

References