I’m using OpenSC at the moment so that I can repurpose an otherwise unused Aladdin eToken to hold SSH keys. I could go through the process involved in setting up the token, but as this chap has already done a thorough job, I won’t go into detail.
Unfortunately, the openssh-client package from Debian (and Ubuntu) doesn’t enable OpenSC support. It’s trivial to rebuild the package with OpenSC support, but for those who don’t want to or can’t for some reason, I’ve put my rebuilt, OpenSC-enabled packages here.
Once installed, if your token is set up correctly, you should be able to get your SSH public key from the card with:-
ssh-keygen -D <card>
…which should give you something like:-
ssh-rsa AAAA .. .. .. t8/Q== 1024 65537 14233 .. .. .. 70941
You can then add your private key to a running SSH agent with:-
ssh-add -s <card>
Pop in your PIN, and ssh should function as if you were using a normally-generated key.