I am trying to access my vps using SSH Key-Based Authentication. this is what i tried:
1.create a public and private key in Windows using PuTTYgen
2.copy the one line format of the public key to a this file /home/username/.ssh/authorised_keys
this is how the key looks like:
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAxjoUKeoEWdpazINZ1WmEiierZ1eC/OtQ6r0MFBofBg3oSvzF0o3mqzJB2rklNAcFoiQ/MHB5nk7lLfb82Ny7np9vYXoprZinM68PSjfhNd20QfXRJfeTaKZqWtzv64r+zOPs3n32FEfSY5x5numk6YqZ1AjbwyU2/HhEUN35FzyjofZjCiR9BM5eaylf8yJ/fgHVoFBVuL7N5jsbPG6fP2ZEIGSBFH6DCN+HEpvySFzdgy2KkznRl0/o1dWc3FU8NaqZG+M1JZzEIjehEuaVwMFrIQxdHXoZCY7OJHHwWFOQCWhYScTh3PeOnvPnU6LYBLgAG+felrdQrho2My9jxw== rsa-key-20191225
3.sudo chmod 700 ~/.ssh
4.sudo chmod 600 ~/.ssh/authorized_keys
5.sudo chown -R $(whoami):$(whoami) ~/.ssh/
When I try to connect with private key loaded in PuTTY I get this error in the log: `
Dec 26 00:27:34 berbidserver sshd[29601]: debug1: Could not open authorized keys '/home/tarantula/.ssh/authorized_keys': No such file or directory
Dec 26 00:27:34 berbidserver sshd[29601]: debug1: restore_uid: 0/0
Dec 26 00:27:34 berbidserver sshd[29601]: debug1: temporarily_use_uid: 1001/1001 (e=0/0)
Dec 26 00:27:34 berbidserver sshd[29601]: debug1: trying public key file /home/tarantula/.ssh/authorized_keys2
Dec 26 00:27:34 berbidserver sshd[29601]: debug1: Could not open authorized keys '/home/tarantula/.ssh/authorized_keys2': No such file or directory
`
authorized_keys{,2}
-- as clearly shown in the log; see the man page. This is true for all versions since at least 5.5 in 2010 and still the case for 9.0 in 2022.