1

I have a linux device which supports authentication with a certificate and a private key.

I have tried to connect with:

k = paramiko.RSAKey.from_private_key_fil("path to privte key")
client.connect(server,port,user, key_filename ="path to certificate file", pkey=k)

I cannot connect in any way to the device.

Under windows with OPEN SSH I can connect to the device with :

ssh root@192.168.0.2 -p 22 -o IdentityFile=C:\client_key\client_key -o CertificateFile=C:\client_key\OTCsigned_certificate
BSMP
  • 4,596
  • 8
  • 33
  • 44
  • Welcome! You might be able to improve your post by adding code blocks using the backtick `. Markdownmode is supported here :-) – ilam engl Mar 26 '22 at 16:06

1 Answers1

1

I have solved the issue by : Renaming the key and the certificate as id_rsa and id_rsa-cert.pub.

At argument key_filename i passed the certificate and alongside with it the paramiko loads also the private key.

It is finally working.

Br,