Gentoo Archives: gentoo-user

From: Kent Fredric <kentfredric@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] Storing ssh and gpg keys in USB flash drives
Date: Thu, 05 Jul 2007 20:28:25
Message-Id: 8cd1ed20707051322u25305959m6179268fa7a29c14@mail.gmail.com
In Reply to: [gentoo-user] [OT] Storing ssh and gpg keys in USB flash drives by "José González Gómez"
1 On 7/5/07, José González Gómez <jgonzalez.openinput@×××××.com> wrote:
2 > Hi there,
3 >
4 > I would like to store my ssh and gpg keys in my usb flash drive, but I'm not
5 > sure what's the best way to do it:
6 >
7 > If I use vfat so I can also read them from Windows I have two problems:
8 > first you must mount your USB key with a 0077 umask, so ssh and gpg doesn't
9 > complain about key permissions; latest KDE version seems to auto mount USB
10 > flash drives using pmount with a 0022 umask and I haven't been able to
11 > change this, so I either mount it manually or change the permissions after
12 > being mounted. The second problem is related to gpg: it seems that gpg uses
13 > links to lock the keyrings, and vfat doesn't support them, so I'm able to
14 > read keys, but not to make any modfication on them.
15 >
16 > If I use ext2 the permission problem goes away (kind of), but I have the
17 > feeling that this isn't as portable as vfat, as the filesystem uses the user
18 > id to control access to files, and pluging the drive in another system where
19 > my user may have anoter uid leads me to chowning/chmoding in the better case
20 > or not having access to my keys in the worst case.
21 >
22 > Any ideas?
23 >
24 > Best regards
25 > Jose
26 >
27
28 vfat{
29 vfatfiles
30 ext2fs{
31 gpg_stuff
32 }
33 }
34
35 1. Mount vfat drive
36 2. dd if=/dev/full bs=1048580 count=4096 of =/mountpoint/mynewextfile
37 3. mkfs.ext2 /mountpoin/mynewextfile
38 4. mount /mountpoint/mynewextfile/ /someothermountpoint/
39 5. cp files to /someothermountpoint/
40 6. use /someothermountpoint/
41 7. umount /someothermountpoint/
42 8. umount /mountpoint/
43
44 I didn't say it would be pretty, but that is a handy trick to have up the sleve.
45 that would make a 4 Meg file containing a filesystem to hold your
46 files, just like a TAR file, except with all the features of ext2 and
47 no need unpack it to use.
48
49 You can do anything with linux, really. Yes. even format a file as a
50 filesystem and mount it
51 ( a word of warning : dont do this and format with reiserfs and then
52 store that file on a reiserfs fs ... if you do, next time you need to
53 --rebuild-tree reiser will try to be smart and trash your drive :) ...
54 learn't the hard way )
55
56 --
57 Kent
58 ruby -e '[1, 2, 4, 7, 0, 9, 5, 8, 3, 10, 11, 6, 12, 13].each{|x|
59 print "enNOSPicAMreil kdrtf@×××.com"[(2*x)..(2*x+1)]}'
60 --
61 gentoo-user@g.o mailing list