-
I'm having a little trouble understanding how to make SSH certificates work for me. Right now I'm trying to use this at home, and doubtless setting up this infrastructure is overkill to the nth degree, but it sounded like an interesting project, so... User certificatesLet me address user certificates first. I have a number of devices I need to log in to, some as
Easy enough, and now that SSH daemon will trust any user certificates issued by the CA. So now I need to get a user certificate. I understand the next step would be to run Host certificatesUsage of these is, I think, quite a bit simpler--add the relevant line to I have an assortment of bare metal servers and virtual machines, the latter running under Proxmox (nothing on AWS/Azure/GCP). Initial cert issuance could be interactive, but given the short lifetimes, I'd want renewal to be automated. How would I go about this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hi @danb35! Sounds like you've got the right high level mental model. Hope you've figured out OIDC! Lemme try to answer your questions.
Yes. We're not doing anything special here, really. The OpenSSH client assumes your remote username is the same as the local username by default, so if they match you don't need to specify one. If they don't match you can also use
Ok, first... you didn't ask, and really it's none of my business, but my personal recommendation is that you probably shouldn't be SSHing as You could get a separate certificate for SSH certificates contain a list of principals. The default behavior of the OpenSSH server is: you're authorized to SSH as user foo if you have user foo in your SSH principal list. With that in mind, you have two other options:
To get an SSH host cert you can use most of the To renew you can run
Paired with a
If you want to tweak this configuration we've got detailed instructions in docs on automated renewal for x509 certificates. Renewal for SSH certificates is gonna be almost identical, but you'll use If you're going this deep, you should probably check out our SSH product, too. It handles a lot of this for you, and it's free forever unless you connect an external identity provider (if you don't connect an identity provider we act as the identity provider for your single user account, so this works fine as long as it's just for you). Even if you don't end up using it, it may be worth setting it up and running through configuration on your client and on a VM somewhere. We handle a lot of this stuff in the product workflows, so it may help you wrap your head around everything (and you can probably reverse engineer some stuff ;). Lemme know if you have any follow-up questions. Good luck! |
Beta Was this translation helpful? Give feedback.
Hi @danb35!
Sounds like you've got the right high level mental model. Hope you've figured out OIDC! Lemme try to answer your questions.
Yes. We're not doing anything special here, really. The OpenSSH client assumes your remote username is the same as the local username by default, so if they match you don't need to specify one. If they don't match you can also use
ssh_config
to specify your username for a specific host, or a group of hosts (if you're curious,man ssh_config
is pretty good / you'll want to check out theHost
,Match exec
andUser
directives).