Quantcast
Channel: Active questions tagged ssh - Ask Ubuntu
Viewing all articles
Browse latest Browse all 859

Ubuntu 22.04 SSH the RSA key isn't working since upgrading from 20.04

$
0
0

Up until last week I was running Ubuntu 20.04 happily, and then over the weekend decided to back everything up and install 22.04. I've had a couple of teething issues which I've solver, however I'm having real issues with SSH. I have two first generation WD MyCloud drives which handle all my backups and files both on and away from home. I can still connect to the shares with no problems, however I need to SSH onto both drives in order to run maintenance, backup between cloud drives, etc.

Initially I couldn't gain SSH access at all after upgrading, however the one-fix at this website worked. I can now connect via SSH and entering a password.

However with Ubuntu 20.04 I had set up a passphrase so that various autyomated scripts that I use using rsync could copy between cloud drives and also between Ubuntu and the cloud drive shares. This was working until I upgraded, now the scripts continually ask me for my password and I can't figure out how to stop it.

What I was originally doing was running

ssh-keygen -b 4096

to generate a passphrase and then

ssh-copy-id root@server

to copy the passphrase across

If I then entered

ssh root@server

it simply connected without asking to my password.

I know this is going to be due to my cloud drives only supporting the now insecure SSH, but I cannot upgrade it to a more secure one (unless someone knows how - I would prefer to do this to be honest). My maintenance scripts can make up to 20 connections over a period of hours, and to have to sit and constantly enter the password is becoming a pain.

Can anyone help me get my remote rsync commands working again so they don't keep asking me for my password

The terminal outputs as I run through these are

colin@colin-desktop:~/.ssh$ ssh-keygen -b 4096Generating public/private rsa key pair.Enter file in which to save the key (/home/colin/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/colin/.ssh/id_rsaYour public key has been saved in /home/colin/.ssh/id_rsa.pubThe key fingerprint is:SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx colin@colin-desktopThe key's randomart image is:+---[RSA 4096]----+...+----[SHA256]-----+colin@colin-desktop:~/.ssh$ ssh-copy-id root@xxx.xxx.xxx.xxx/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keysroot@xxx.xxx.xxx.xxx's password: Number of key(s) added: 1Now try logging into the machine, with:   "ssh 'root@xxx.xxx.xxx.xxx'"and check to make sure that only the key(s) you wanted were added.colin@colin-desktop:~/.ssh$ ssh root@xxx.xxx.xxx.xxxroot@xxx.xxx.xxx.xxx's password: Linux NASServer 3.2.26 #1 SMP Thu Jul 9 11:14:15 PDT 2015 wd-2.4-rel armv7lThe programs included with the Debian GNU/Linux system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright.Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extentpermitted by applicable law.NASServer:~# cd ~/.sshNASSERVER:~/.ssh# ls -altotal 12drwx------ 2 root root 4096 May 17 23:32 .drwx------ 7 root root 4096 Apr 28 19:02 ..-rw------- 1 root root  742 May 17 23:32 authorized_keysNASServer:~/.ssh# exitlogoutConnection to xxx.xxx.xxx.xxx closed.colin@colin-desktop:~$ rsync --verbose --archive -e 'ssh -p 22' ~/Files/ root@xxx.xxx.xxx.xxx:/shares/Files/root@xxx.xxx.xxx.xxx's password: 

How this originally came about was that I needed to be able to rsync to and from a remote location without the need for a human intervention regarding security. The instructions I was given were to use ssh-keygen to generate public/private keys and then ssh-copy-id to copy the public key to the remote host. I've just reinstalled 20.04 on another machine and used this successfully and the rsync is working without the need for a password. However if I clear the keys on the server out, reinstall 22.04 and do the same, it still prompts me for the password. I've updated my question to show the output of the commands as they are being run on Ubuntu 22.04 with the server name obscured for obvious reasons.

The Terminal output of rsync -vvv follows

colin@colin-desktop:~$ ssh -vvv root@xxx.xxx.xxx.xxxOpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022debug1: Reading configuration data /home/colin/.ssh/configdebug3: kex names ok: [diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com]debug1: Reading configuration data /etc/ssh/ssh_configdebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no filesdebug1: /etc/ssh/ssh_config line 21: Applying options for *debug2: resolve_canonicalize: hostname xxx.xxx.xxx.xxx is addressdebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/colin/.ssh/known_hosts'debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/colin/.ssh/known_hosts2'debug3: ssh_connect_direct: enteringdebug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22.debug3: set_sock_tos: set socket 3 IP_TOS 0x10debug1: Connection established.debug1: identity file /home/colin/.ssh/id_rsa type 0debug1: identity file /home/colin/.ssh/id_rsa-cert type -1debug1: identity file /home/colin/.ssh/id_ecdsa type -1debug1: identity file /home/colin/.ssh/id_ecdsa-cert type -1debug1: identity file /home/colin/.ssh/id_ecdsa_sk type -1debug1: identity file /home/colin/.ssh/id_ecdsa_sk-cert type -1debug1: identity file /home/colin/.ssh/id_ed25519 type -1debug1: identity file /home/colin/.ssh/id_ed25519-cert type -1debug1: identity file /home/colin/.ssh/id_ed25519_sk type -1debug1: identity file /home/colin/.ssh/id_ed25519_sk-cert type -1debug1: identity file /home/colin/.ssh/id_xmss type -1debug1: identity file /home/colin/.ssh/id_xmss-cert type -1debug1: identity file /home/colin/.ssh/id_dsa type -1debug1: identity file /home/colin/.ssh/id_dsa-cert type -1debug1: Local version string SSH-2.0-OpenSSH_8.9p1 Ubuntu-3debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4debug1: compat_banner: match: OpenSSH_6.0p1 Debian-4 pat OpenSSH* compat 0x04000000debug2: fd 3 setting O_NONBLOCKdebug1: Authenticating to xxx.xxx.xxx.xxx:22 as 'root'debug3: send packet: type 20debug1: SSH2_MSG_KEXINIT sentdebug3: receive packet: type 20debug1: SSH2_MSG_KEXINIT receiveddebug2: local client KEXINIT proposaldebug2: KEX algorithms: diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,curve25519-sha256,curve25519-sha256@libssh.org,sntrup761x25519-sha512@openssh.com,ext-info-cdebug2: host key algorithms: ssh-ed25519,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-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-ecdsa-sha2-nistp256-cert-v01@openssh.comdebug2: ciphers ctos: 3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.comdebug2: ciphers stoc: 3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.comdebug2: MACs ctos: hmac-sha1,hmac-sha1-96,hmac-sha2-256,hmac-sha2-512,hmac-md5,hmac-md5-96,umac-64@openssh.com,umac-128@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-md5-etm@openssh.com,hmac-md5-96-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.comdebug2: MACs stoc: hmac-sha1,hmac-sha1-96,hmac-sha2-256,hmac-sha2-512,hmac-md5,hmac-md5-96,umac-64@openssh.com,umac-128@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-md5-etm@openssh.com,hmac-md5-96-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.comdebug2: compression ctos: none,zlib@openssh.com,zlibdebug2: compression stoc: none,zlib@openssh.com,zlibdebug2: languages ctos: debug2: languages stoc: debug2: first_kex_follows 0 debug2: reserved 0 debug2: peer server KEXINIT proposaldebug2: KEX algorithms: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1debug2: host key algorithms: ssh-rsa,ssh-dssdebug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.sedebug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.sedebug2: MACs ctos: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96debug2: MACs stoc: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96debug2: compression ctos: none,zlib@openssh.comdebug2: compression stoc: none,zlib@openssh.comdebug2: languages ctos: debug2: languages stoc: debug2: first_kex_follows 0 debug2: reserved 0 debug1: kex: algorithm: diffie-hellman-group1-sha1debug1: kex: host key algorithm: ssh-rsadebug1: kex: server->client cipher: 3des-cbc MAC: hmac-sha1 compression: nonedebug1: kex: client->server cipher: 3des-cbc MAC: hmac-sha1 compression: nonedebug2: bits set: 515/1024debug3: send packet: type 30debug1: expecting SSH2_MSG_KEX_ECDH_REPLYdebug3: receive packet: type 31debug1: SSH2_MSG_KEX_ECDH_REPLY receiveddebug1: Server host key: ssh-rsa SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXdebug3: record_hostkey: found key type RSA in file /home/colin/.ssh/known_hosts:1debug3: load_hostkeys_file: loaded 1 keys from xxx.xxx.xxx.xxxdebug1: load_hostkeys: fopen /home/colin/.ssh/known_hosts2: No such file or directorydebug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directorydebug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directorydebug1: Host 'xxx.xxx.xxx.xxx' is known and matches the RSA host key.debug1: Found key in /home/colin/.ssh/known_hosts:1debug2: bits set: 495/1024debug3: send packet: type 21debug2: ssh_set_newkeys: mode 1debug1: rekey out after 134217728 blocksdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug3: receive packet: type 21debug1: SSH2_MSG_NEWKEYS receiveddebug2: ssh_set_newkeys: mode 0debug1: rekey in after 134217728 blocksdebug1: get_agent_identities: bound agent to hostkeydebug1: get_agent_identities: agent returned 1 keysdebug1: Will attempt key: /home/colin/.ssh/id_rsa RSA SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX agentdebug1: Will attempt key: /home/colin/.ssh/id_ecdsa debug1: Will attempt key: /home/colin/.ssh/id_ecdsa_sk debug1: Will attempt key: /home/colin/.ssh/id_ed25519 debug1: Will attempt key: /home/colin/.ssh/id_ed25519_sk debug1: Will attempt key: /home/colin/.ssh/id_xmss debug1: Will attempt key: /home/colin/.ssh/id_dsa debug2: pubkey_prepare: donedebug3: send packet: type 5debug3: receive packet: type 6debug2: service_accept: ssh-userauthdebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug3: send packet: type 50debug3: receive packet: type 51debug1: Authentications that can continue: publickey,passworddebug3: start over, passed a different list publickey,passworddebug3: preferred gssapi-with-mic,publickey,keyboard-interactive,passworddebug3: authmethod_lookup publickeydebug3: remaining preferred: keyboard-interactive,passworddebug3: authmethod_is_enabled publickeydebug1: Next authentication method: publickeydebug1: Offering public key: /home/colin/.ssh/id_rsa RSA SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX agentdebug1: send_pubkey_test: no mutual signature algorithmdebug1: Trying private key: /home/colin/.ssh/id_ecdsadebug3: no such identity: /home/colin/.ssh/id_ecdsa: No such file or directorydebug1: Trying private key: /home/colin/.ssh/id_ecdsa_skdebug3: no such identity: /home/colin/.ssh/id_ecdsa_sk: No such file or directorydebug1: Trying private key: /home/colin/.ssh/id_ed25519debug3: no such identity: /home/colin/.ssh/id_ed25519: No such file or directorydebug1: Trying private key: /home/colin/.ssh/id_ed25519_skdebug3: no such identity: /home/colin/.ssh/id_ed25519_sk: No such file or directorydebug1: Trying private key: /home/colin/.ssh/id_xmssdebug3: no such identity: /home/colin/.ssh/id_xmss: No such file or directorydebug1: Trying private key: /home/colin/.ssh/id_dsadebug3: no such identity: /home/colin/.ssh/id_dsa: No such file or directorydebug2: we did not send a packet, disable methoddebug3: authmethod_lookup passworddebug3: remaining preferred: ,passworddebug3: authmethod_is_enabled passworddebug1: Next authentication method: passwordroot@xxx.xxx.xxx.xxx's password: 

Viewing all articles
Browse latest Browse all 859

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>