blob: 7bbb0753bdcc05bfb00890753d4059c4c2e88b11 [file] [log] [blame]
Damien Millerd97c2ce2001-09-18 15:06:21 +10001How to use smartcards with OpenSSH?
2
Damien Millerc18c06e2003-06-10 18:55:22 +10003OpenSSH contains experimental support for authentication using
4Cyberflex smartcards and TODOS card readers. To enable this you
5need to:
Damien Miller8124e1a2001-09-25 10:21:28 +10006
Damien Millerc18c06e2003-06-10 18:55:22 +10007(1) enable SMARTCARD support in OpenSSH:
Damien Miller8124e1a2001-09-25 10:21:28 +10008
Damien Millerc18c06e2003-06-10 18:55:22 +10009 $ ./configure --with-smartcard [...]
10 and rebuild
Damien Millerd97c2ce2001-09-18 15:06:21 +100011
Damien Millerc18c06e2003-06-10 18:55:22 +100012(2) If you have used a previous version of ssh with your card, you
13 must remove the old applet and keys.
Damien Millerd97c2ce2001-09-18 15:06:21 +100014
Damien Millerc18c06e2003-06-10 18:55:22 +100015 $ sectok
16 sectok> login -d
17 sectok> junload Ssh.bin
18 sectok> delete 0012
19 sectok> delete sh
20 sectok> quit
Damien Millerd97c2ce2001-09-18 15:06:21 +100021
Damien Millerc18c06e2003-06-10 18:55:22 +100022(3) load the Java Cardlet to the Cyberflex card and set card passphrase:
Damien Millerd97c2ce2001-09-18 15:06:21 +100023
24 $ sectok
25 sectok> login -d
26 sectok> jload /usr/libdata/ssh/Ssh.bin
Damien Millerd97c2ce2001-09-18 15:06:21 +100027 sectok> setpass
Damien Millerc18c06e2003-06-10 18:55:22 +100028 Enter new AUT0 passphrase:
29 Re-enter passphrase:
Damien Millerd97c2ce2001-09-18 15:06:21 +100030 sectok> quit
31
Damien Millerd97c2ce2001-09-18 15:06:21 +100032 Do not forget the passphrase. There is no way to
33 recover if you do.
34
35 IMPORTANT WARNING: If you attempt to login with the
36 wrong passphrase three times in a row, you will
37 destroy your card.
38
Damien Millerc18c06e2003-06-10 18:55:22 +100039(4) load a RSA key to the card:
Damien Millerd97c2ce2001-09-18 15:06:21 +100040
Damien Millerc18c06e2003-06-10 18:55:22 +100041 $ ssh-keygen -f /path/to/rsakey -U 1
42 (where 1 is the reader number, you can also try 0)
Damien Millerd97c2ce2001-09-18 15:06:21 +100043
Damien Millerc18c06e2003-06-10 18:55:22 +100044 In spite of the name, this does not generate a key.
45 It just loads an already existing key on to the card.
Damien Millerd97c2ce2001-09-18 15:06:21 +100046
Damien Millerc18c06e2003-06-10 18:55:22 +100047(5) tell the ssh client to use the card reader:
Damien Millerf6195f22002-04-23 22:48:46 +100048
Damien Millerc18c06e2003-06-10 18:55:22 +100049 $ ssh -I 1 otherhost
Damien Millerf6195f22002-04-23 22:48:46 +100050
Damien Millerc18c06e2003-06-10 18:55:22 +100051(6) or tell the agent (don't forget to restart) to use the smartcard:
Damien Millerf6195f22002-04-23 22:48:46 +100052
Damien Millerc18c06e2003-06-10 18:55:22 +100053 $ ssh-add -s 1
Damien Millerf6195f22002-04-23 22:48:46 +100054
Damien Millerc18c06e2003-06-10 18:55:22 +100055(7) Optional: If you don't want to use a card passphrase, change the
56 acl on the private key file:
Damien Millerf6195f22002-04-23 22:48:46 +100057
Damien Millerc18c06e2003-06-10 18:55:22 +100058 $ sectok
59 sectok> login -d
60 sectok> acl 0012 world: w
61 world: w
62 AUT0: w inval
63 sectok> quit
Damien Millerf6195f22002-04-23 22:48:46 +100064
Damien Millerc18c06e2003-06-10 18:55:22 +100065 If you do this, anyone who has access to your card
66 can assume your identity. This is not recommended.
Damien Millerd97c2ce2001-09-18 15:06:21 +100067
68-markus,
Damien Millerc18c06e2003-06-10 18:55:22 +100069Tue Jul 17 23:54:51 CEST 2001
70
71$OpenBSD: README.smartcard,v 1.8 2002/03/26 18:56:23 rees Exp $