I'm using PuTTY on Windows 11 to connect to Ubuntu Server 20.04.4. SSH connection with password works, but when I try to connect to it with a key I get the password prompt again. I turned logging on, turns out my server doesn't accept RSA: mm_answer_keyallowed: publickey authentication test: RSA key is not allowed
.
I've found out that OpenSSH 8.8 doesn't allow RSA (SHA-1) keys by default, and while I wasn't sure my keys were SHA-1 (PuTTY has a separate SSH-1 (RSA) key type that I didn't use, I used the default RSA one) I tried a different key type (one of those recommended here).
I tried generating and ECDSA key just to get the result mm_answer_keyallowed: publickey authentication test: ECDSA key is not allowed
.
Here is an example with the RSA key:
debug1: trying public key file /home/wintermute/.ssh/authorized_keys
debug1: fd 5 clearing O_NONBLOCK
debug2: /home/wintermute/.ssh/authorized_keys:1: check options: '---- BEGIN SSH2 PUBLIC KEY ----\r\n'
debug2: /home/wintermute/.ssh/authorized_keys:1: advance: 'BEGIN SSH2 PUBLIC KEY ----\r\n'
debug2: /home/wintermute/.ssh/authorized_keys:2: check options: 'Comment: "rsa-key-20220310"\r\n'
debug2: /home/wintermute/.ssh/authorized_keys:2: advance: '"rsa-key-20220310"\r\n'
debug2: /home/wintermute/.ssh/authorized_keys:3: check options: 'AAAAB3NzaC1yc2EAAAADAQABAAABAQCQskShaece0af5fHVTwPu/nFhDGwOoqxhP\r\n'
debug2: /home/wintermute/.ssh/authorized_keys:3: advance: ''
debug2: /home/wintermute/.ssh/authorized_keys:4: check options: 'S/9h4URK6axdsae5Um3EWhiTFlNdukPHtDZ1ZCcO7n4zGB90NyNyszgZ4XGYpuCR\r\n'
debug2: /home/wintermute/.ssh/authorized_keys:4: advance: ''
debug2: /home/wintermute/.ssh/authorized_keys:5: check options: '/JthkwXs9MmhAB+PYXeCnCsOyFtY9VkStvu8OuHmj9QJXAHlvukKHlpEh7yAD3Q6\r\n'
debug2: /home/wintermute/.ssh/authorized_keys:5: advance: ''
debug2: /home/wintermute/.ssh/authorized_keys:6: check options: 'qkyD4LDbw4H+n9el98U4Lgah/xEuKCNFAwsYfZ2+hqFtvdwnARcqYRvQnSrbh6Cg\r\n'
debug2: /home/wintermute/.ssh/authorized_keys:6: advance: ''
debug2: /home/wintermute/.ssh/authorized_keys:7: check options: 'l18vruoGn6oLCmDL5iWkgILJ+5l934p/NtemdJZBnXPvc1Whd1/MsrLzOt0tbStA\r\n'
debug2: /home/wintermute/.ssh/authorized_keys:7: advance: ''
debug2: /home/wintermute/.ssh/authorized_keys:8: check options: 'JlabiywG87OgcaQ/yoIGTKmgjNtRvWscycq1RW+VWdW4wph6PT9L\r\n'
debug2: /home/wintermute/.ssh/authorized_keys:8: advance: ''
debug2: /home/wintermute/.ssh/authorized_keys:9: check options: '---- END SSH2 PUBLIC KEY ----\r\n'
debug2: /home/wintermute/.ssh/authorized_keys:9: advance: 'END SSH2 PUBLIC KEY ----\r\n'
debug1: restore_uid: 0/0
debug1: temporarily_use_uid: 1000/1000 (e=0/0)
debug1: trying public key file /home/wintermute/.ssh/authorized_keys2
debug1: Could not open authorized keys '/home/wintermute/.ssh/authorized_keys2': No such file or directory
debug1: restore_uid: 0/0
debug3: mm_answer_keyallowed: publickey authentication test: RSA key is not allowed
Failed publickey for wintermute from 192.168.0.130 port 52984 ssh2: RSA SHA256:NhGXwSWgy7fV2KZ2p8B0RcxWr/qBwwG8RNUNo2EXrgc
What am I doing wrong?