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.
ssh-keygen
I changed/added following lines in the SSH setting file "C:\ProgramData\ssh\sshd_config"
PermitRootLogin yesAllowUsers otheruserPubkeyAuthentication yesPasswordAuthentication 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 tmp@192.168.0.102
and failed.
> ssh -i C:\_sync_\id_rsa tmp@192.168.0.102tmp@192.168.0.102: Permission denied (publickey,keyboard-interactive).
So, how can I solve this SSH public key authentication issue?