OSError: No such private key file when using OPENSSH PRIVATE KEY
See original GitHub issueSo this took a few hours for me to figure out, and wanted to post the solution online.
Basically paramiko doesn’t support openssh private key format before version 2.7.
Solution A: Ensure paramiko is at least version 2.7
pip3 install paramiko --upgrade
Solution B: Convert your private key to PEM format (usable by paramiko <=2.6)
ssh-keygen -p -m PEM -f ./your_private_key
You’re welcome.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Mac OS , Error when generating an SSH key with Git: “no such ...
Generating public/private rsa key pair. Enter file in which to save the key (/home/hp/.ssh/id_rsa): "Press Enter on your Keyboard" (note ...
Read more >Not using private key file - Adobe Support Community
According to the log file, my server is running OpenSSH 7.4 and my local OpenSSH is version 8.8. Bug Unresolved. TOPICS. Other ...
Read more >Mac OS , Error when generating an SSH key with Git - iTecNote
Git – Mac OS , Error when generating an SSH key with Git: “no such file”. gitmacosssh. I want to work with GitHub...
Read more >Set up SSH public key authentication to connect to a remote ...
Using SSH public key authentication to connect to a remote system is a robust, more secure alternative to logging in with an account ......
Read more >SSH Suddenly returning Invalid format - Server Fault
Even if it's not the private key you need, the ssh agent won't return invalid format if the key is working, you simply...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great. Thanks @Fizzadar
Implemented the warning in https://github.com/Fizzadar/pyinfra/commit/6347e352a3b6ed0dc038e50c9ded52af75ae8b40 (and fixed the general not found vs. invalid key error message), released in
1.3.9
just now!