i recently wanted to use ssh-keys instead of passwords for my server (Debian stretch). I am using an ubuntu subsystem on Windows (in case it matters).
I was following the top answer from this thread: Easiest way to copy ssh keys to another machine?
I did the following:
- Created a key with
ssh-keygenand saved them at.ssh/xxx.pub ssh-copy-id -i .ssh/xxx.pub user@server.tld
After this step I got the following message:
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: ".ssh/xxx.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@tserver.tld's password:
Number of key(s) added: 1
I even checked on the server under ~/.ssh/authorized_keys there is the key.
But still when I try to connect to the server via:
ssh root@server.tld
I have to login with password.
Has someone an idea why this does not work?