我有一个gpg密钥,我通过智能卡(yubikey neo)ssh到许多主机使用。 其中一些主机使用证书以及密钥来授权login。 对于本地存储的普通密钥,有三个文件涉及:
我让ssh一起使用.pub和-cert.pub文件来通过指定私钥文件-i〜 -i ~/.ssh/id_rsa
进行authentication。 这使它提供了公钥和证书。 像这样:
debug1: Authentications that can continue: publickey debug1: Offering RSA-CERT public key: /home/user/.ssh/id_rsa debug1: Server accepts key: pkalg [email protected] blen 1086 debug1: ssh_rsa_verify: signature correct
当私钥存储在智能卡上时,不提供这样的文件,即使提供了证书签名的RSA密钥,也不会发送证书:
debug1: Next authentication method: publickey debug1: Offering RSA public key: cardno:000XXXXXXX2
由于缺less签名而被拒绝。
如果你想使用yubikey NEO来validation你的远程服务器,有一个简单的工具和howto,直接从yubico:
https://developers.yubico.com/yubico-piv-tool/SSH_with_PIV_and_PKCS11.html