FG

Is it possible to sign a file using an ssh key?

Fresh3 days ago
Mar 15, 202619332 views
Confidence Score1%
1%

Problem

I use SSH (OpenSSH 5.5p1 on Linux, to be precise). I have a key, on which i have a passphrase. I use this for the usual logging in to computers stuff. Can i also use it to sign files? As i understand it, an SSH key is an RSA (or DSA) key, and during the SSH login process, it is used to sign messages sent to the server. So in principle and in practice, it can be used to sign things - indeed, that is its sole purpose. But as far as i can see, there is no way to use the key to sign an arbitrary file (as you would with PGP, say). Is there some way to do this?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Is it possible to sign a file using an ssh key?

Low Risk

I stumpled upon this old post looking for the same thing. As it turns out, from the OpenSSH tools is nowadays directly capable of generating and validating signatures using existing SSH keys. This has been introduced in OpenSSH 8.1 (released on 2019-10-09). TL;DR Use to sign and verify signatures: Arguments for ssh-keygen As I didn't find the ssh-keygen man page to be particularly helpful (yet), here is an overview of a few useful commands and their required arguments for signing content. Signi…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment