My pc is running Lubuntu 20.04.
I am trying to ssh to a raspberry pi 4 running Ubuntu Server 22.04.
I have followed the setup instructions but see the following:
ssh -v [email protected]
OpenSSH_8.2p1 Ubuntu-4ubuntu0.11, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /home/paul/.ssh/config
debug1: /home/paul/.ssh/config line 1: Applying options for *
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 *
debug1: Connecting to 192.168.1.121 [192.168.1.121] port 22.
debug1: Connection established.
debug1: identity file /home/paul/.ssh/id_rsa type 0
debug1: identity file /home/paul/.ssh/id_rsa-cert type -1
debug1: identity file /home/paul/.ssh/id_dsa type -1
debug1: identity file /home/paul/.ssh/id_dsa-cert type -1
debug1: identity file /home/paul/.ssh/id_ecdsa type -1
debug1: identity file /home/paul/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/paul/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/paul/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/paul/.ssh/id_ed25519 type -1
debug1: identity file /home/paul/.ssh/id_ed25519-cert type -1
debug1: identity file /home/paul/.ssh/id_ed25519_sk type -1
debug1: identity file /home/paul/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/paul/.ssh/id_xmss type -1
debug1: identity file /home/paul/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.11
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1 Ubuntu-3ubuntu0.6
debug1: match: OpenSSH_8.9p1 Ubuntu-3ubuntu0.6 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.1.121:22 as 'paul'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:hB5vu/iLN16xccrKvXJVhJcCL09bFePcmv/GwEwNEL0
debug1: Host '192.168.1.121' is known and matches the ECDSA host key.
debug1: Found key in /home/paul/.ssh/known_hosts:9
debug1: resetting send seqnr 3
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: resetting read seqnr 3
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /home/paul/.ssh/id_rsa RSA SHA256:o4u2FI6udyWLZqKgV2itDrRJaTQYn65ochhOFkPYfd4
debug1: Will attempt key: /home/paul/.ssh/id_dsa
debug1: Will attempt key: /home/paul/.ssh/id_ecdsa
debug1: Will attempt key: /home/paul/.ssh/id_ecdsa_sk
debug1: Will attempt key: /home/paul/.ssh/id_ed25519
debug1: Will attempt key: /home/paul/.ssh/id_ed25519_sk
debug1: Will attempt key: /home/paul/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected]>
debug1: kex_input_ext_info: [email protected] (unrecognised)
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/paul/.ssh/id_rsa RSA SHA256:o4u2FI6udyWLZqKgV2itDrRJaTQYn65ochhOFkPYfd4
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/paul/.ssh/id_dsa
debug1: Trying private key: /home/paul/.ssh/id_ecdsa
debug1: Trying private key: /home/paul/.ssh/id_ecdsa_sk
debug1: Trying private key: /home/paul/.ssh/id_ed25519
debug1: Trying private key: /home/paul/.ssh/id_ed25519_sk
debug1: Trying private key: /home/paul/.ssh/id_xmss
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey).
I added some options to my ~/.ssh/config as recommended by various posts (to no avail). It is:
Host *
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
I use this stuff about once every year, when I get a new Pi (each year making extensive notes on what I did), but every year it fails in different ways. Any solutions would be very welcome.
Thanks to user68186 - his solution worked.
I made ed25519 keys (on client and server) and copied both keys to their counterpart machine. To be precise:
On pc:
On rpi4