Wednesday, June 15, 2016

SCP/SSH keeps reprompting for private key password

Problem:

I was trying to copy a file to my newly created Oracle Compute Cloud instance from one of my Linux servers.

But every time I entered the password, it kept reprompting me:
root@demo:/u01> scp -i "oracloud.ppk" filename.txt opc@129.129.129.129:/tmpEnter passphrase for key 'oracloud.ppk':Enter passphrase for key 'oracloud.ppk':Enter passphrase for key 'oracloud.ppk':
However, running the same command from Windows with the same private key seemed to work:
P:\temp> pscp -i "oracloud.ppk" filename.txt opc@129.129.129.129:/tmp

Solution:

It worked on Windows because I was using pscp.exe which is Putty's implementation which uses the private key in PuTTY PPK format. But on Linux, use the private key saved in OpenSSH format instead.

1. Use the private key that was saved in the OpenSSH format:
root@demo:/u01> scp -i "oracloud.ssh" filename.txt opc@129.129.129.129:/tmp


Applicable Versions:
  • Oracle Compute Cloud Service (2016)


References:





No comments: