22.11.2014 Views

Using OpenSSH with smartcards Why use OpenSSH with smart ...

Using OpenSSH with smartcards Why use OpenSSH with smart ...

Using OpenSSH with smartcards Why use OpenSSH with smart ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Using</strong> <strong>OpenSSH</strong> <strong>with</strong> <strong><strong>smart</strong>cards</strong><br />

debug1: pkcs11_provider_unref: 0x153fb90 refcount 2<br />

debug1: Authentication succeeded (publickey).<br />

debug1: channel 0: new [client-session]<br />

debug1: Requesting no-more-sessions@openssh.com [6]<br />

debug1: Entering interactive session.<br />

Linux firewall 2.6.32-trunk-486 #1 Sun Jan 10 05:53:18 UTC 2010 i686<br />

The programs included <strong>with</strong> the Debian GNU/Linux system are free software;<br />

the exact distribution terms for each program are described in the<br />

individual files in /usr/share/doc/*/copyright.<br />

Debian GNU/Linux comes <strong>with</strong> ABSOLUTELY NO WARRANTY, to the extent<br />

permitted by applicable law.<br />

Last login: Thu Apr 1 16:57:20 2010 from xxxxxxxxxxxx<br />

Make sure that <strong>OpenSSH</strong> is asking for PIN and not using local keys in ~/.ssh on the client side.<br />

<strong>Using</strong> scp <strong>with</strong> <strong><strong>smart</strong>cards</strong><br />

scp allows to specify any <strong>OpenSSH</strong> syntax using -o switch.<br />

GNU/Linux:<br />

To <strong>use</strong> <strong>smart</strong> cards, add this switch to your scp command line:<br />

-o PKCS11Provider=/usr/lib/opensc-pkcs11.so<br />

Therefore a common file transfer using scp would be:<br />

$ scp -v -o PKCS11Provider=/usr/lib/opensc-pkcs11.so filename <strong>use</strong>r@host:path<br />

To ease connection, you may add this line to /etc/ssh/ssh_config:<br />

PKCS11Provider /usr/lib/opensc-pkcs11.so<br />

Mac OS X:<br />

To <strong>use</strong> <strong>smart</strong> cards, add this switch to your scp command line:<br />

-o PKCS11Provider=/Library/OpenSC/lib/opensc-pkcs11.so<br />

Therefore a common file transfer using scp would be:<br />

$ scp -v -o PKCS11Provider=//Library/OpenSC/lib/opensc-pkcs11.so filename <strong>use</strong>r@host:path<br />

To ease connection, you may add this line to /opt/local/etc/ssh/ssh_config:<br />

PKCS11Provider /Library/OpenSC/lib/opensc-pkcs11.so<br />

It is possible to enter several filenames or wildcards to avoid sending multiple commands:<br />

$ scp -v filename1 filename2 filename-other* <strong>use</strong>r@host:path<br />

Copyright GOOZE 2010-2011 http://www.gooze.eu 10 / 15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!