blob: 17bbde7210c24752024eb2a9ad44f4150a8a6969 [file] [log] [blame]
Damien Millerd97c2ce2001-09-18 15:06:21 +10001How to use smartcards with OpenSSH?
2
3OpenSSH contains experimental support for authentication using
Damien Miller8124e1a2001-09-25 10:21:28 +10004Cyberflex smartcards and TODOS card readers.
5
6WARNING: Smartcard support is still in development. Keyfile formats, etc
7are still subject to change.
8
9To enable this you need to:
Damien Millerd97c2ce2001-09-18 15:06:21 +100010
Ben Lindstroma42694f2002-04-05 16:11:45 +000011(1) install sectok or openSC
Damien Millerd97c2ce2001-09-18 15:06:21 +100012
Damien Miller7a62b772001-09-18 15:44:34 +100013 Sources are instructions are available from
14 http://www.citi.umich.edu/projects/smartcard/sectok.html
Damien Millerd97c2ce2001-09-18 15:06:21 +100015
Ben Lindstroma42694f2002-04-05 16:11:45 +000016 or
17
18 http://www.opensc.org/
19
Damien Millerd97c2ce2001-09-18 15:06:21 +100020(2) enable SMARTCARD support in OpenSSH:
21
Ben Lindstroma42694f2002-04-05 16:11:45 +000022 $ ./configure --with-sectok[=/path/to/libsectok] [options]
Damien Miller7a62b772001-09-18 15:44:34 +100023
Ben Lindstroma42694f2002-04-05 16:11:45 +000024 or
Damien Miller7a62b772001-09-18 15:44:34 +100025
Ben Lindstroma42694f2002-04-05 16:11:45 +000026 $ ./configure --with-opensc[=/path/to/opensc] [options]
Damien Millerd97c2ce2001-09-18 15:06:21 +100027
28(3) load the Java Cardlet to the Cyberflex card:
29
30 $ sectok
31 sectok> login -d
32 sectok> jload /usr/libdata/ssh/Ssh.bin
33 sectok> quit
34
35(4) load a RSA key to the card:
36
37 please don't use your production RSA keys, since
38 with the current version of sectok/ssh-keygen
39 the private key file is still readable
40
41 $ ssh-keygen -f /path/to/rsakey -U 1
42 (where 1 is the reader number, you can also try 0)
43
44 In spite of the name, this does not generate a key.
45 It just loads an already existing key on to the card.
46
47(5) optional:
48
49 Change the card password so that only you can
50 read the private key:
51
52 $ sectok
53 sectok> login -d
54 sectok> setpass
55 sectok> quit
56
57 This prevents reading the key but not use of the
58 key by the card applet.
59
60 Do not forget the passphrase. There is no way to
61 recover if you do.
62
63 IMPORTANT WARNING: If you attempt to login with the
64 wrong passphrase three times in a row, you will
65 destroy your card.
66
67(6) tell the ssh client to use the card reader:
68
69 $ ssh -I 1 otherhost
70
71(7) or tell the agent (don't forget to restart) to use the smartcard:
72
73 $ ssh-add -s 1
74
75-markus,
76Tue Jul 17 23:54:51 CEST 2001