[CLUE-Tech] User Mount of Encrypted Volumes vi Loopback

David Anselmi anselmi at americanisp.net
Tue Nov 25 21:16:16 MST 2003


Jed S. Baer wrote:
[...]
> One other thing though, is that in order to create an ext2 (or 3 for that
> matter) filesystem, you have to use the losetup command (unlike mkisofs).
> And it isn't by default setuid. So what it comes down to is that there
> isn't any way, AFAICT, for a non-root user to create/manage their own
> little encrypted virtual disk. Or, at least not using anything I can find.
> At two points, you need root access: 1) losetup, 2) editing /etc/fstab.

The losetup bit doesn't seem right.  I just created a file, made it ext2 
(per Zonker's method) and mounted it as a normal user.  I think this is 
doable (you have to get root to put the right stuff in fstab, but that's 
always the case, isn't it?)

The only thing I might have done differently was to specify a loop 
device I owned.  I also didn't fool with encryption, but did you specify 
the encryption option to mount in your fstab?

Here's a summary:

~$ sudo modprobe loop

~$ dd if=/dev/zero of=myLoop bs=1024 count=1024

~$ mkfs -t ext2 myLoop

~$ sudo mknod loop b 7 7

~$ sudo chown dave.dave loop

~$ mount -t ext2 -o loop=loop myLoop tmp

~$ mount myLoop

Voila.  Here's the fstab line:

<file> <mount pt> ext2 rw,user,noauto,loop=/home/dave/loop 0 0

HTH,
Dave




More information about the clue-tech mailing list