Hello & thanks for the replies.
This issue is resolved.
Reviewing my initial post, I failed to mention I was trying to log in as root.
The cause of the problem was that someone had changed the sshd_config file.
Specifically, they changed the line:
PermitRootLogin yes, to no
to resolve edit this line to read:
PermitRootLogin yes
I was editing using nano, so I then did:
Ctrl O (to save)
and then
Ctrl X (to exit out of editing the file)
and then run
sudo systemctl reload sshd
That said, you both asked great questions (of which are relevant to my other post and the whole reason why I enabled root login, which was to create a new user that I can ssh in via ssh key. See my post "
Added newuser in Ubuntu with SSH key but unable to access as newuser" as it is currently unresolved.
The answer to your questions (as it may help others & me on my other post)...
Regarding: What operating system is on your PC?
> I'm using Windows 10 (I have a desktop and a laptop and I've tried both just in case something was running on one that would have been corrupting the clipboard when I copied/pasted the key into the authorized_keys file.
Regarding: How many keys are there with the correct syntax?
>All (1-3) Appear to have the correct syntax. I've tried one at a time, and have also left some in there (up to 3) where each key is on a single line and only a single line space separates each key. I've tried Ed25519 (as my root key is and it now works :-) ), but this morning I've also tried an RSA 4096 bit key as well.
Regarding: And in which file did you really put the keys?
> For root, I've been logging in as root and typing: nano /etc/.ssh/authorized_keys. Along the same thought, in sshd_config, the AuthorizedKeysFile line has ~/.ssh/authorized_keys
So for root, the path was/is correct. However, for my other post when creating a new user, this may be where I messed up. For anyone having issues logging in with an ssh key with a newly created user, see the above link as I'm guessing this may get resolved soon.
Regarding: They (the SSH key(s)) need to be whole and unbroken with a single line per key and in the right format, including the right end-of-line character.
> I don't know what the "right end-of-line character" means. I select the public key open ssh code from puttygen, (only the text) and right click on the authorized_keys file to paste. I've wondered and tried not hitting a return in the file and after pasting immediately saved ( ctrl O ) but it didn't seem to make a difference.
Thank you