0

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 :(

Ivs
  • 1
  • 1
  • 4

1 Answers1

0

The issue was I had encryption enabled on my home folder on the server, which meant it could not read the authorized_keys file before I logged in. Resolved by removing the encryption on the home folder.

Ivs
  • 1
  • 1
  • 4