3 ms·
Like I said, it's been a few years so maybe things have changed since then. But if I recall... x509 supports all of the things that ssh key file format does ..
by inetknght 5y ago
Like I said, it's been a few years so maybe things have changed since then. But if I recall...
x509 supports all of the things that ssh key file format does ... and also a lot more. ssh supports x.509 too so that makes it "easier". When you use `ssh` to connect, you'd specify -I and point to the private key and it will automatically try to find a certificate file whose name is identical to the identity file but with "-cert.pub" appended (see `man ssh_config`). There's another option to explicitly specify the key certificate file `CertificateFile` but there's no short-argument version so you have to use `-o CertificateFile [filename]` or add that to your `~/ssh/.config` file.
You'd need to use `openssl` command (or, of course, any openssl-like command line) to sign the your SSH key. And, of course, openssl doesn't understand ssh key files so you have to use `ssh-keygen` to convert the key to x509 format or else generate the key using `openssl` (but again, at least ssh understands x509 natively so the downside is having the much longer x509 text). And that's quite the arcane part: openssl cli is fucking awful. It doesn't follow normal command line conventions, doesn't have tab autocompletion, and its documentation is obscure/difficult to find, extremely terse, and difficult to even understand if you're not already explicitly familiar with exactly your inputs and outputs.
And then there's the whole process of getting your key file signed. At least that process is (in general) identical to having a web SSL key signed -- because the private key is actually identical but the only nominal difference is the format of the file that you normally think of using for it. But the workflow is different because the certificate doesn't get installed to somewhere that a webserver would want. I had ended up creating my own Certificate Authority to test with and that was yet another rabbit hole of anger management.
- blueflow 5y agoYeah, you should re-educate yourself. Like i said, i used SSH certificates managed exclusively with ssh-keygen, i don't have any connection between the OpenSSL and SSH cryptosystems, nor do i see a point in that. My advice: Disregard any blog posts mucking SSH certs with OpenSSL and take the same time to read the ssh-keygen manpage.
- inetknght 5y ago> Yeah, you should re-educate yourself. Thanks! That sounds quite condescending. I'd educated myself by reading about ssh keys in ssh and wondering how to use them. Perhaps you should make your own blog post describing how to do it all using only ssh-keygen then.
- blueflow 5y agoHere is my "blogpost": https://www.man7.org/linux/man-pages/man1/ssh-keygen.1.html https://www.man7.org/linux/man-pages/man1/ssh-keygen.1.html . The signing process is the `ssh-keygen -I` part. The source of truth (in sync with your currently installed version) is right on your disk. Invoke `man ssh-keygen`. Sorry for my tone. I'm pissed that, every second day, some person comes along and demonstrates to me that I'm seemingly the only person in the world who is reading the documentation on the tools we all use. Like, how do you even know what you are doing?
- inetknght 5y agoAnd yet: I did read the documentation and using openssl was the solution I had come up with. Perhaps I was using a nonstandard version of ssh. Telling people to "just read the documentation" is quite condescending when they're demonstrating that they've come up with a different solution. It was years ago and I don't remember what version I was using. Indeed, using ssh-keygen for the whole process certainly seems easier.
- blueflow 5y agoI'm sorry for my harsh words.