passforios
passforios copied to clipboard
[Feature] Use GPG --export-ssh-key to use with git authentication
Since GPG 2.1.11 it is possible to export a SSH key from a GPG sub-key with authentication usage. This exports a SSH public key which than can be used to authenticate with git. Using this function a user does not have to import a SSH key. Also some users might not even use native SSH keys anymore because of the convenience of just having to manage one type on key.
Possible Problem: The key has multiple sub-keys with authentication usage and not the first one is used to generate the SSH key. GPG does use the first by default. App would need a way to select the right one.
More information: What’s new in GnuPG 2.1
Copy from gpg man page for --export-ssh-key
This command is used to export a key in the OpenSSH public key format. It requires the
specification of one key by the usual means and exports the latest valid subkey which
has an authentication capability to STDOUT or to the file given with option --output.
That output can directly be added to ssh's ‘authorized_key’ file.
By specifying the key to export using a key ID or a fingerprint suffixed with an excla‐
mation mark (!), a specific subkey or the primary key can be exported. This does not
even require that the key has the authentication capability flag set.