I've set up ubuntu server on an old desktop and was able to log in with password no problem. I then set up ssh keys and disallowed logging in with passwords. I now have this weird issue where I get a public key denied error when trying to ssh remotely UNLESS I connect a monitor to the old desktop and log in to the server locally, then log in to the server remotely using the keys - this works.
I've checked the permissions for both the .ssh files/folders on both machines and they're fine: 755 for home directories, 700 for .ssh, 644 for id_rsa.pub, and 600 for id_rsa and authorized_keys.
Any idea what's going on here?
~/.ssh/config
and/etc/ssh/sshd_config
files.