Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ssh-add : Invalid key length

Tags:

ssh

After my mac upgraded automatically, I try ssh-add fail:

>ssh-add
Enter passphrase for /Users/dan/.ssh/id_rsa:
Error loading key "/Users/dan/.ssh/id_rsa": Invalid key length

>ssh -V
OpenSSH_7.6p1, LibreSSL 2.6.2

But how can I fix this issue?

Thanks!

like image 669
Dan Avatar asked Jan 02 '18 02:01

Dan


1 Answers

As per the release notes for OpenSSH 7.6:

Refuse RSA keys <1024 bits in length and improve reporting
for keys that do not meet this requirement.

So it's likely that the key you're trying to import is too short (weak). Your best bet is to generate a new key.

like image 63
TheAmigo Avatar answered Nov 05 '22 21:11

TheAmigo