# MacOS – chyba SSH – No Matching Exchange Method Found

> Zdroj: https://www.elvisek.cz/2022/09/macos-chyba-ssh-no-matching-exchange-method-found/ · Autor: ElvisEK · Publikováno: 9. 9. 2022 · Rubrika: macOS

Při používání remote managementu [Royal TS](https://www.royalapps.com/ts/mac/features) se po upgradu MacOS nelze připojit na SSH, který končí s chybou

```bash
Unable to negotiate with ssh_server port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
```

Tato chyba je způsobena slabým šifrováním nebo použitým algoritmem. Řešením je upravení souboru **/etc/ssh/ssh_config**.

Konkrétně přidání následujících řádků:

```
## přidat tyto řádky
   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-512
   HostkeyAlgorithms ssh-dss,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256
   KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group14-sha1
```

Po této změně se oprava projeví okamžitě.

![](https://www.elvisek.cz/wp-content/uploads/2022/12/image-2.webp)

---

update 02.10.2024

po updatu na MacOS Sequoia nepomohl zápis do **/etc/ssh/ssh_config**, ale řešením je zápis do lokální konfigurace v souboru **~/.ssh/config**:

```
Host *
    KexAlgorithms +diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    HostKeyAlgorithms +ssh-rsa
    Ciphers aes128-cbc,3des-cbc
```
