Problems with creating an SSH CA, attempting to following the tutorial as a guide

  • Posted on February 12, 2015
  • beltorakAsked by beltorak

Hi; I am attempting to follow the tutorial posted here as a guide.

I’ve created three LXC machines to practice with: ssh-ca, ssh-server, and ssh-client.

On ssh-ca I self-signed the “ssh_host_ed25519_key” yielding “”.

I transferred the ssh-server “” to the ssh-ca machine as “”, signed it with the ssh-ca’s “ssh_host_ed25519_key” yielding “”, and transferred this back to ssh-server as “”. I edited ssh-server’s “sshd_config” to add HostCertificate /etc/ssh/ and restarted the ssh-server sshd daemon (service ssh restart).

I transferred the ssh-ca “” to ssh-client and stuck it in ~/.ssh/known_hosts file as (roughly)

@cert-authority * AAAAIHN ... QFRDQ==  root@trusty-builds

However, attempting to log in from ssh-client to ssh-server (abbreviated ssh -v output):

debug1: Server host key: ED25519-CERT 85:46:34:5f:93:4c:d0:f5:c3:a4:14:87:38:b9:41:7d
debug1: ssh_ed25519_verify: signature correct
debug1: No matching CA found. Retry with plain key
The authenticity of host ' (' can't be established.
ED25519 key fingerprint is 85:46:34:5f:93:4c:d0:f5:c3:a4:14:87:38:b9:41:7d.
Are you sure you want to continue connecting (yes/no)?

What am I doing wrong? Is * a valid hostname wildcard? Is it possible I messed up one of my signing commands? How could I verify that the ssh-server cert is signed by the ssh-ca key?


Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

The ssh client tries to validate the hostname given in the certificate the server sent. The hostname had to be given after the -n switch, when signing the server’s public key.

ssh-keygen -s server_ca -I host_host1 -h -n -V +52w /etc/ssh/

If you have forgotten the name, you can also see it in the debug messages when you try to connect to the server via ssh with -vv. (I had the same problem…)

debug1: Server host certificate: SHA256:...
debug2: Server host certificate hostname:
debug1: No matching CA found. Retry with plain key
The authenticity of host ' (' can't be established.

When trying to connect to the host via IP, one has to give the hostname in the options:

ssh -o root@

* is a valid hostname wildcard.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.