I am having a weird issue with SSH keys on my Ubuntu 18.04 Server PC. The server is just a PC that is connected to my main router at home.
I recently disabled SSH password authentication on the server to improve security, and as such, I generated SSH keys for my client PCs and transferred them to the server using ssh-copy-id user@ip
(before disabling password auth). This worked fine, up until I had to restart the server, after which I keep getting the Permission denied (publickey)
error.
The weird part is that if I connect the server PC to the same network powerline adapter as my client PC, which is directly connected to the main router, it works fine, but as soon as I move it back to the main router, it throws the same error.
Anyone have any idea what may be causing this?
Edit:
So turns out the issue is not related to the powerline adapter. The server does not accept SSH unless I have logged in once on the server machine, after which it works fine. But I still can't figure out how to resolve this issue either :(