I'm trying to set up public key authentication on a CentOS 7.3 guest, using WSL.
When trying to copy the public key using
ssh-copy-id, it's rejected, saying it already exists on the VM. This is not the case, since it's a fresh install, and there isn't even an
.ssh directory in
After searching around, wrong file permissions seems to be a possible error, so I ran these commands:
chmod go-w ~
chmod go-w ~ chmod 0700 ~/.ssh chmod 0600 ~/.ssh/config chmod 0600 ~/.ssh/id_rsa chmod 0644 ~/.ssh/id_rsa.pub chmod 0600 ~/.ssh/known_hosts
On the server in
sshd_config public key authentication is enabled. The result of
ssh-copy-id was the same.
However when I ran
ssh-copy-id -o "LogLevel VERBOSE" root@ip it prompted me for the password, and then successfully copied over the key. After which I could use
ssh root@ip, and successfully authenticate using my key.
ssh using password authentication worked the whole time.
Why didn't it work with normal
ssh-copy-id, but it did using
ssh-copy-id -o "LogLevel VERBOSE"?
What did I miss?