I'm trying to connect to Windows through SSH with public key authentication. But apparently not working.
Here are what I have done.
I installed and activated the SSH on the windows.
Get-WindowsCapability -Online | ? Name -like 'OpenSSH*' Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
I generated public key files and sent to the remote machine to ssh from.
I changed/added following lines in the SSH setting file "C:\ProgramData\ssh\sshd_config"
PermitRootLogin yes AllowUsers otheruser PubkeyAuthentication yes PasswordAuthentication no
I restarted the ssh server to apply the setting changes.
net stop sshd ; net start sshd
I tried to ssh from the remote machine (also windows, powershell) to the windows machine
ssh -i C:\_sync_\id_rsa firstname.lastname@example.org
> ssh -i C:\_sync_\id_rsa email@example.com firstname.lastname@example.org: Permission denied (publickey,keyboard-interactive).
So, how can I solve this SSH public key authentication issue?