I'm using PC without Administrator privileges and I need to set up SSH server. I've tried mobaSSH and also freeSSHd but both requires Administrator privileges. Then I've found Win32-OpenSSH which seems that it might be finally working. To be honest I do not actually understand why such services requires Administrator privileges because I've set up e.g. FTP server listening on port 21 with no problems but OK, back to the question.
I've run ssh-keygen.exe -A
included in Win32-OpenSSH which created following files in Win32-OpenSSH directory:
ssh_host_dsa_key
ssh_host_dsa_key.pub
ssh_host_ecdsa_key
ssh_host_ecdsa_key.pub
ssh_host_ed25519_key
ssh_host_ed25519_key.pub
ssh_host_rsa_key
ssh_host_rsa_key.pub
Then I've started sshd.exe
. My first attempt was to connect with putty.exe
using: USERNAME@localhost
. I've used same credentials as I'm using to Windows login but it did not work:
Using username "USERNAME".
USERNAME@localhost's password:
Access denied
USERNAME@localhost's password:
Second attempt was using puttygen.exe
to convert ssh_host_rsa_key
to *.ppk
file and load this file with pageant.exe
and then use same step as in first attempt. After this the sshd.exe
message changed as you can see but login still did not work:
Using username "USERNAME".
Authenticating with public key "imported-openssh-key" from agent
Server refused public-key signature despite accepting key!
USERNAME@localhost's password:
Access denied
USERNAME@localhost's password:
I guess that the server is installed correctly and the problem is with authentication. How to correctly set up Win32-OpenSSH to being able login either using password or key?
Best Answer
For a password authentication, use just
USERNAME
. TheUSERNAME@localhost
cannot work.To make the public key authentication working:
.ssh
folder withauthorized_keys
file with your public key in your Windows account profile folder (typically inC:\Users\username\.ssh
).For details on both, see my guide to Installing SFTP/SSH Server on Windows using OpenSSH.