question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading Key Invalid Format

See original GitHub issue

Hi guys,

Doing something slightly unconventional - running this on Windows. I already resolved one issue (subprocess.run needs shell=True added or it fails to load files. However, now I’m having issues with key format. I’ve uploaded my private key and the file name as described, but unfortunately I’m getting this error:

DEBUG:root:Running ssh-add
Error loading key "(stdin)": invalid format
WARNING:root:Could not add key to the SSH agent

It appears it fails somewhere in the subprocess.run for SSH add, maybe the input? I’m not sure the best thing to look for to debug this problem. Any thoughts or direction would be appreciated!

Thanks, Brandin.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Brandincommented, Jun 21, 2022

maybe it could be related to the linebreak characters?

I’m thinking it could be an issue with the API and the data being returned to the CLI. I’ve reached out to Bitwarden and will report back with my findings. Right now I’m getting a 404 for the attachment, so I think what was being retrieved was old data despite the vault saying its up to date.

0reactions
modem7commented, Dec 14, 2022

@Brandin - Try generating an SSH key using the below script:

https://github.com/modem7/public_scripts/blob/master/Batch + Powershell/ed25519gen.bat

I’ve not had any problems with keys generated in this method (except for WinSCP which doesn’t like anything not PuTTY based).

Make sure ssh-keygen is installed. I’ve installed OpenSSH via Powershell, unsure if that’ll help any.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSH Suddenly returning Invalid format - Server Fault
Check the contents of key_name , if the agent says invalid format , then there's something wrong with the key - like .....
Read more >
31 - Super User
Your OpenSSL version refuses to load this key format. ... It worked but complained with 'invalid format' each time I did server operations....
Read more >
SSH Key Format Issues and Fixing the “invalid format” Error
In this tutorial, we talk about issues with the format of keys when establishing an SSH session. First, we generate a sample key...
Read more >
Google Groups
Load key "/.ssh/identity/id_rsa": invalid format. (filename depends on what id I select). The id file (without .pub) is just:.
Read more >
'Invalid Format' Error Connecting to Server with SSH and ...
If you get an 'invalid format' error when trying to SSH in to a remote server using a private key file that you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found