ssh regularly and have
ssh-agent set up.
How can I use
ssh keys to
gpg-encrypt a file?
Edit: It seems that this is impossible. Why?
ssh can encrypt traffic, so why not also files?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
No, SSH keys are not PGP keys and serve different purpose .
You must have PGP keys in GnuPG keyring.
But - you can convert GPG keys to SSH keys (using
gpgkey2ssh) and gpg-agent can take care of SSH keys (using --enable-ssh option). I believe no such tool exists for converting SSH keys to GPG keys and cannot exist.
It seems that this is impossible. Why? ssh can encrypt traffic, so why not also files?
SSH can encrypt, just not in a GPG compatible manner.
openssl enc -aes-256-cbc -in my.pdf -out mydata.enc
openssl enc -aes-256-cbc -d -in mydata.enc -out mydecrypted.pdf
should do the trick.