I'm trying to connect to Windows user through SSH (public key authentication) from a remote machine over the internet using ngrok. 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 yes
AllowUsers otheruser
PubkeyAuthentication yes
PasswordAuthentication no
I restarted the ssh server to apply the setting changes.
net stop sshd ; net start sshd
I installed ngrok and run ngrok
./ngrok tcp 22
# got "6.tcp.ngrok.io:25252"
I tried to ssh from the remote machine to the windows machine, using the "tmp" secret key file to the user "tmp".
ssh -i "C:\pg\.ssh\tmp" [email protected] -p 25252
and failed.
ssh -i "C:\pg\.ssh\tmp" [email protected] -p 25252
Enter passphrase for key 'C:\pg\.ssh\tmp':
[email protected]: Permission denied (publickey,keyboard-interactive).