There is a library called CRaSH, that was integrated in spring boot. The docs says, that in order to connect with ssh using key, you must add 2 lines of code in config (link) and write path to a pem key
So, I added those lines, like:
shell.auth=key
shell.auth.key.path=/home/user/.ssh/id_rsa
When I try to connect, it says permission denied (public key) When I change id_rsa to id_rsa.pub it crashes on startup with exception. Maybe because it's not pem key So, I tried to convert it
openssl req -x509 -key id_rsa -nodes -days 365 -newkey rsa:2048 -out id_rsa.pem
it results to: Key type org.bouncycastle.cert.X509CertificateHolder not supported On windows with keys generated by puttygen the picture is almost the same What I'm doing wrong?
This might be quite late, but this setup helps me to connect with ssh and key to a crash shell (version 1.3.1):
I convert my openssh/putty key to pem
openssl rsa -in authorized.rsa -outform pem -pubout > authorized.pem
Then I configured crash via spring:
After starting my server it is possible to connect with putty: