Ubuntu – What’s the password of an SSH private key

pythonssh

I've never seen this window when doing ssh over the terminal, but now I'm using a python script that does ssh over the paramiko python module and I'm asked to provide a password (that I don't remember setting) in order to unlock the private key username@hostname. I tried my root password but it won't work.

The entire window says:

Enter password to unlock the private key

An application wants access to the private key 'user@host' , but
it's locked

What is this password? I've never needed it.

Best Answer

According to this SO Q&A - How to ssh connect through python Paramiko with public key

paramiko uses OpenSSH format keys. and it expect to get encrypted key as input so you also need to decrypt the key first.

  • Here you can see how to use putty in order to convert your PGP key into OpenSSH key format:

    To create a valid DSA format private key supported by Paramiko in Puttygen. Click on Conversions then Export OpenSSH Key

  • Here you can find simple python script which uses the key and paramiko.