Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple keys / Specific key selection for SSH #850

Open
rally-dimi opened this issue Nov 9, 2023 · 1 comment
Open

Multiple keys / Specific key selection for SSH #850

rally-dimi opened this issue Nov 9, 2023 · 1 comment

Comments

@rally-dimi
Copy link

Is there a way to choose key using label or pid tp present to SSH service ?
For example when connecting to gihub, when there are 2 keys, first key would be used and push would fail - if second one have permissions.

Host github-work
  HostName github.com
  User git
  PKCS11Provider /usr/lib/x86_64-linux-gnu/libtpm2_pkcs11.so.1
  ForwardAgent yes
  PasswordAuthentication no
  IdentitiesOnly yes

  
Host github-home
  HostName github.com
  User git
  PKCS11Provider /usr/lib/x86_64-linux-gnu/libtpm2_pkcs11.so.1
  PasswordAuthentication no
  IdentitiesOnly yes
@rally-dimi
Copy link
Author

Some debug logs:

GIT_SSH_COMMAND="ssh -vvv" git clone [email protected]:<project>.git
...
debug1: Will attempt key: /usr/lib/x86_64-linux-gnu/libtpm2_pkcs11.so.1.6.0 RSA SHA256:<key1> agent
debug1: Will attempt key: /usr/lib/x86_64-linux-gnu/libtpm2_pkcs11.so.1.6.0 RSA SHA256:<key2> agent
...
debug1: Server accepts key: /usr/lib/x86_64-linux-gnu/libtpm2_pkcs11.so.1.6.0 RSA SHA256:<key1> agent
...
authenticated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant