How to connect SSH Key and fix bad configuration option ssh-ed25519?

Viewed 12118

After generating the ssh key, when I push to the remote GitHub server, this is an error message I can see in my terminal:

/Users/.ssh/config: line 1: Bad configuration option: ssh-ed25519
/Users/.ssh/config: terminating, 1 bad configuration options

How to resolve it?

3 Answers

Considering Linux and MacOS OpenSSH implemention can diff, you can follow this article

I got this error when I attempted to use the .ssh/config file from macOS on my laptop with LMDE4:

greys@xps:~ $ ssh mcfly
/home/greys/.ssh/config: line 14: Bad configuration option: usekeychain
/home/greys/.ssh/config: terminating, 1 bad configuration options

Because this option is a generic one I have at the very top of my .ssh/config file, it means I can’t connect anywhere until I fix or comment this "UseKeychain yes" option.

Luckily, there’s a simple enough fix: just add the IgnoreUnknown directive into .ssh/config right above the "UseKeychain yes", and it will be ignored on Linux systems.
On macOS it will still keep working as intended.

Here’s how the updated fragment of .ssh/config should look:

IgnoreUnknown UseKeychain
UseKeychain yes

It sounds like you've accidentally placed an SSH public key into ~/.ssh/config, since ssh-ed25519 is the first part of a certain type of public key.

If that's the case, you can edit that file and remove the offending line, which should make OpenSSH happy again.

Related