SSH No Matching Cipher on fresh install

  1. I previously requested advice on choosing a new router. Very popular WiFi 5Ghz router for long term support OpenWRT - #3 by tapper
  2. I ordered the GL-MT6000.
  3. I installed OpenWRT 23.05.5 with a system upgrade. Easy, but I was surprised that Wifi turns Off, and Eth is now required. (Needed to switch from configuring on Mobile to a device with Eth port)
  4. I want to install a package. I was able to install through the GUI LUCI great.
  5. I need to use SSH edit a file to configure the package. No problem, I'm no stranger to SSH.
  6. Type in ssh root@192.168.1.1 and receive the error.

Unable to negotiate with 192.168.1.1 port 22: no matching cipher found. Their offer: chacha20-poly1305@openssh.com,aes128-ctr,aes256-ctr

  1. I try to force each of the 3 key types like so:

ssh -o HostKeyAlgorithms=aes256-ctr root@192.168.1.1
command-line line 0: Bad key types 'aes256-ctr'

All report bad key type. There appears to be no way to edit files from within LUCI.

So perhaps I'm overlooking something. I ask this helpful community, what are the suggested actions for me to take now?

That's a client side issue, not Openwrt.

Search the forum for
ssh -o HostKeyAlgorithms

2 Likes

hostkey and cypher and mac are different independent aspects of encrypted socket. it is described in your local ssh client manual page.

2 Likes

Use -o ciphers= instead.

1 Like
dimoni@dimoni-MS-7C94:~$ ssh -vv root@192.168.1.19
OpenSSH_8.9p1 Ubuntu-3ubuntu0.10, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /home/dimoni/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolve_canonicalize: hostname 192.168.1.19 is address
debug1: Connecting to 192.168.1.19 [192.168.1.19] port 22.
debug1: Connection established.
debug1: identity file /home/dimoni/.ssh/id_rsa type 0
debug1: identity file /home/dimoni/.ssh/id_rsa-cert type -1
debug1: identity file /home/dimoni/.ssh/id_ecdsa type -1
debug1: identity file /home/dimoni/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/dimoni/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/dimoni/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/dimoni/.ssh/id_ed25519 type 3
debug1: identity file /home/dimoni/.ssh/id_ed25519-cert type -1
debug1: identity file /home/dimoni/.ssh/id_ed25519_sk type -1
debug1: identity file /home/dimoni/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/dimoni/.ssh/id_xmss type -1
debug1: identity file /home/dimoni/.ssh/id_xmss-cert type -1
debug1: identity file /home/dimoni/.ssh/id_dsa type -1
debug1: identity file /home/dimoni/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.10
debug1: Remote protocol version 2.0, remote software version dropbear
debug1: compat_banner: no match: dropbear
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 192.168.1.19:22 as 'root'
debug1: load_hostkeys: fopen /home/dimoni/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,sntrup761x25519-sha512@openssh.com,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c,kex-strict-c-v00@openssh.com
debug2: host key algorithms: ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,kexguess2@matt.ucc.asn.au
debug2: host key algorithms: ssh-ed25519,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes256-ctr
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes256-ctr
debug2: MACs ctos: hmac-sha1,hmac-sha2-256
debug2: MACs stoc: hmac-sha1,hmac-sha2-256
debug2: compression ctos: none
debug2: compression stoc: none
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:OGq/ivqI3c9UWH2q5nWmvri9AYilz0BEQrwPc2XWMnM
debug1: load_hostkeys: fopen /home/dimoni/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host '192.168.1.19' is known and matches the ED25519 host key.
debug1: Found key in /home/dimoni/.ssh/known_hosts:72
debug2: ssh_set_newkeys: mode 1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug2: ssh_set_newkeys: mode 0
debug1: rekey in after 134217728 blocks
debug1: get_agent_identities: bound agent to hostkey
debug1: get_agent_identities: agent returned 2 keys
debug1: Will attempt key: /home/dimoni/.ssh/id_rsa RSA SHA256:piEgMrPZGU0OAHgnrDIht+7MtUkFVlFPppH41SfPcSU agent
debug1: Will attempt key: /home/dimoni/.ssh/id_ed25519 ED25519 SHA256:s04OPn2tlaRVeUPwQqutiKnvizqwWrkftSBzzk3p0e4 agent
debug1: Will attempt key: /home/dimoni/.ssh/id_ecdsa 
debug1: Will attempt key: /home/dimoni/.ssh/id_ecdsa_sk 
debug1: Will attempt key: /home/dimoni/.ssh/id_ed25519_sk 
debug1: Will attempt key: /home/dimoni/.ssh/id_xmss 
debug1: Will attempt key: /home/dimoni/.ssh/id_dsa 
debug2: pubkey_prepare: done
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,rsa-sha2-256,ssh-rsa>
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /home/dimoni/.ssh/id_rsa RSA SHA256:piEgMrPZGU0OAHgnrDIht+7MtUkFVlFPppH41SfPcSU agent
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Offering public key: /home/dimoni/.ssh/id_ed25519 ED25519 SHA256:s04OPn2tlaRVeUPwQqutiKnvizqwWrkftSBzzk3p0e4 agent
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/dimoni/.ssh/id_ecdsa
debug1: Trying private key: /home/dimoni/.ssh/id_ecdsa_sk
debug1: Trying private key: /home/dimoni/.ssh/id_ed25519_sk
debug1: Trying private key: /home/dimoni/.ssh/id_xmss
debug1: Trying private key: /home/dimoni/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
root@192.168.1.19's password: 


your current OS is old simply look at code a negotiation key
cheers!

2 Likes

My current OS is too old perhaps? I am using Termux to attempt login, but I appear to have a newer version of Ssh than you?

OpenSSH_9.9p1, OpenSSL 3.3.2 3 Sep 2024
debug1: Reading configuration data /data/data/com.termux/files/home/.ssh/config
debug1: /data/data/com.termux/files/home/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /data/data/com.termux/files/usr/etc/ssh/ssh_config
debug1: /data/data/com.termux/files/usr/etc/ssh/ssh_config line 20: include /data/data/com.termux/files/usr/etc/ssh/ssh_config.d/*.conf matched no files
debug2: resolve_canonicalize: hostname 192.168.1.1 is address
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to 192.168.1.1 [192.168.1.1] port 22.
debug1: Connection established.
debug1: identity file /data/data/com.termux/files/home/.ssh/id_rsa type -1
debug1: identity file /data/data/com.termux/files/home/.ssh/id_rsa-cert type -1
debug1: identity file /data/data/com.termux/files/home/.ssh/id_ecdsa type -1
debug1: identity file /data/data/com.termux/files/home/.ssh/id_ecdsa-cert type -1
debug1: identity file /data/data/com.termux/files/home/.ssh/id_ecdsa_sk type -1
debug1: identity file /data/data/com.termux/files/home/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /data/data/com.termux/files/home/.ssh/id_ed25519 type 3
debug1: identity file /data/data/com.termux/files/home/.ssh/id_ed25519-cert type -1
debug1: identity file /data/data/com.termux/files/home/.ssh/id_ed25519_sk type -1
debug1: identity file /data/data/com.termux/files/home/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /data/data/com.termux/files/home/.ssh/id_xmss type -1
debug1: identity file /data/data/com.termux/files/home/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.9
debug1: Remote protocol version 2.0, remote software version dropbear
debug1: compat_banner: no match: dropbear
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 192.168.1.1:22 as 'root'
debug1: load_hostkeys: fopen /data/data/com.termux/files/usr/etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /data/data/com.termux/files/usr/etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: sntrup761x25519-sha512,sntrup761x25519-sha512@openssh.com,mlkem768x25519-sha256,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c,kex-strict-c-v00@openssh.com
debug2: host key algorithms: ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256
debug2: ciphers ctos: aes128-gcm@openssh.com
debug2: ciphers stoc: aes128-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,kexguess2@matt.ucc.asn.au,kex-strict-s-v00@openssh.com
debug2: host key algorithms: ssh-ed25519,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes256-ctr
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes256-ctr
debug2: MACs ctos: hmac-sha1,hmac-sha2-256
debug2: MACs stoc: hmac-sha1,hmac-sha2-256
debug2: compression ctos: none
debug2: compression stoc: none
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
Unable to negotiate with 192.168.1.1 port 22: no matching cipher found. Their offer: chacha20-poly1305@openssh.com,aes128-ctr,aes256-ctr
1 Like

Try
ssh-keygen -f "/home/yourusermane/.ssh/known_hosts" -R "192.168.1.1"

and go to connect now at the promt type yes

I also see that you don't have any known hosts in your code. no macth files, no

debug1: load_hostkeys: fopen /data/data/com.termux/files/usr/etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /data/data/com.termux/files/usr/etc/ssh/ssh_known_hosts2: No such file or directory

You can't test from a normal console

edit from my code you can see

debug1: Host '192.168.1.19' is known and matches the ED25519 host key.
debug1: Found key in /home/dimoni/.ssh/known_hosts:72