sshopenssh

Sign_and_send_pubkey: no mutual signature supported


I tried to connect to ssh server in M1 macOS terminal like this

ssh -i {myKeyFilePath/myKeyFile.pem} user@host

but it returns

sign_and_send_pubkey: no mutual signature supported
user@host: Permission denied (publickey).

I didn't modify any ssh settings, and the file permissions of {myKeyFile.pem} is 400. Also I can connect ssh server well by IntelliJ remote hosts, but when I tried this in terminal, it goes wrong.


Solution

  • When I updated my Mac system, all the ssh server can't ssh with the private key, you can add the 3 lines below in the beginning of your ~/.ssh/config. This will make ssh use a deprecated algorithm for a specific host (use * to target all hosts, but this is unsafe).

    But the best solution is create a new private key and upload the public key to each server one by one, because when you got this error, means your private key is deprecated to use.

    # vim ~/.ssh/config, add the lines at the beginning
    Host host.example.com
        PubkeyAcceptedKeyTypes=+ssh-rsa
        HostKeyAlgorithms=+ssh-rsa