Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow duplicate step ssh config --set keys #1151

Closed
lungj opened this issue Apr 12, 2024 · 2 comments
Closed

Allow duplicate step ssh config --set keys #1151

lungj opened this issue Apr 12, 2024 · 2 comments
Assignees
Labels
enhancement needs triage Waiting for discussion / prioritization by team
Milestone

Comments

@lungj
Copy link

lungj commented Apr 12, 2024

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

I'm adding smallstep to a preexisting environment. Some ssh users have ed25519 fingerprints for servers, others have ecdsa fingerprints, and some ssh clients (embedded systems) only support rsa.

When using step ssh config --set Certificate=... --set Key=..., the ssh server is reconfigured to only serve one certificate via one key type. If the key type doesn't match the fingerprint in users' known_hosts file, they get a MITM warning -- or, if it's an unsupported key type, they can't log in.

Why is this needed?

It eases transitions for users and provides backwards compatibility.

Implementation notes

If multiple Certificate and Key keys can be set in step, sshd_config can do most of the rest of the work since it allows multiple HostCertificate and HostKey lines, e.g.,

Match all
	TrustedUserCAKeys /etc/ssh/ca.pub
	HostCertificate /etc/ssh/ssh_host_ed25519_key-cert.pub
	HostKey /etc/ssh/ssh_host_ed25519_key
	HostCertificate /etc/ssh/ssh_host_ecdsa_key-cert.pub
	HostKey /etc/ssh/ssh_host_ecdsa_key

The ssh clients can then fall back as necessary.

@lungj lungj added enhancement needs triage Waiting for discussion / prioritization by team labels Apr 12, 2024
@maraino
Copy link
Collaborator

maraino commented Apr 15, 2024

Hi @lungj, when you initialize a CA with step ca init --ssh you can edit the templates that the CA will use:

$ cat templates/ssh/sshd_config.tpl
Match all
	TrustedUserCAKeys /etc/ssh/ca.pub
	HostCertificate /etc/ssh/{{.User.Certificate}}
	HostKey /etc/ssh/{{.User.Key}}%

You can adjust this to your needs.

@maraino
Copy link
Collaborator

maraino commented Apr 16, 2024

Hi @lungj, I'm going to close this issue, as you can update the template. Feel free to reopen if this doesn't solve your issue.

@maraino maraino closed this as completed Apr 16, 2024
@hslatman hslatman modified the milestones: v0.26.3, v0.26.2 Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

No branches or pull requests

3 participants