[ssh_x509] X509v3 RSA hostkey support
ssh_x509 at roumenpetrov.info
ssh_x509 at roumenpetrov.info
Thu Aug 8 10:37:46 EEST 2024
Hi Murugesh,
На 7.08.24 г. в 14:57 ч., ssh_x509 at roumenpetrov.info написа:
> Hi,
>
> I am looking for understanding how to configure the SSH Server with x509v3
> hostkey support. I have an RSA based private key and certificate both in
> PEM format. From readme.x509v3 I see the below:
>
> (snip)
>
> How to use X.509 certificates with SSH?Identity or hostkey file
> contain private key and may contain X.509certificate that match it.
> Note that key and X.509 certificate has tobe in PEM format. To use
> X.509 certificate as identity or hostkey usershould convert
> certificate in PEM format and append to file. After thiswith
> "ssh-keygen -y ..." user must update "pub" file.File (identity or
> hostkey) with X.509 certificate (PKCS#8 key format):-----BEGIN PRIVATE
> KEY-----.....-----END PRIVATE KEY----------BEGIN
> CERTIFICATE-----.....-----END CERTIFICATE-----
Regression tests create X.509 certificate based host key See
tests/CA/testhostkey_eccnistp256-rsa_sha256 for example.
>
>
> (snip)
>
> My understanding is - its enough to have a single hostkey file - where I
> can append RSA private key PEM content and RSA certificate PEM content.
> Then configure that file as a HostKey file.
Yes. Valid for client as well.
So in such case client and daemon are ready to use all supported
algorithms either certificate based of based on "plain" key.
>
> Query 1:
>
> I could not understand the part "After this with ssh-keygen user must
> update the pub file". Is this step really needed ? Since we can specify
> both private PEM key and public PEM certificate in a single file - what is
> the necessity for this ssh-keygen - and .pub file ? Can I skip this step ?
In brief - it is recommended to keep synchronised content between files.
Long story: If a file with private key is not password protected
pub-file is useless.
But you may want to send public part of host-key to clients. So, file is
ready.
Functionality of pub-file exist for compatibility with plain keys - to
be similar.
Content of pub-file could be used as record (line) in authorised keys or
known hosts files
>
> Query 2:
>
> If I have only a single file which has both private key and certificate -
> then how will the public key load be handled during server startup ?
If load of pub-file fail program code try to load from private.
PKIX-SSH support one functionality to allows plain-key to accept
certificate as certificate also contain public part. So, if exit
pub-file with plain key code will not refuse such configuration.
>
> Thanks in advance.
OFF topic:
Use of pub-files is mostly for client where user may have more that one
identity. Client will try identity-1, identity 2 and etc until server
accept an identity or refuse connection due to too many attempts.
Let assume that private key is protected. To avoid to ask for password
for each identity content of pub-file is used. Public part is not protected.
>
> Thanks,
> Murugesh
Roumen
More information about the ssh_x509
mailing list