Having a really hard time with public key authentication - help requested!

Advertisement

kjs00333
Joined:
Posts:
5
Location:
USA

Having a really hard time with public key authentication - help requested!

Hopefully someone who's a little more experienced in setting up sftp can lend a hand. I'm using server 2016, and I have followed the directions from this link here: https://winscp.net/eng/docs/guide_windows_openssh_server

But no matter what I do, the server keeps rejecting my key. I used Puttygen to create a key pair. I copied the "public key" contents into my /.ssh/authorized_keys file. In Winscp, I went into the advanced options and set it to use my private key file under SSH > Authentication. My sshd_config located in C:\ProgramData\ssh is set for "PubkeyAuthentication yes" Password authentication is set to No (although it works fine when using password auth). the "AuthorizedKeysFile" section is set to /.ssh/authorized_keys. The permissions on the Authorized_keys file is set only for "The main account, administrators, and System" I really don't know where I'm going wrong here.. Any help is greatly appreciated!

Description: This error is after being asked to put in a username

4-10-2020 6-26-29 PM.jpg

Description: This is from Puttygen. I'm following the directions and copying the contents into my authorized_keys file.

4-10-2020 6-25-05 PM.jpg

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,253
Location:
Prague, Czechia

Re: Having a really hard time with public key authentication - help requested!

What do you mean by "/.ssh/authorized_keys file"? You are on Windows, there's no /.ssh. Actually there's no /.ssh even on *nix.

Have you seen this section?
https://winscp.net/eng/docs/guide_windows_openssh_server#key_authentication

Btw, this is support forum for WinSCP. This is not really a WinSCP question. Consider asking as https://superuser.com/

Reply with quote

kjs00333
Joined:
Posts:
5
Location:
USA

Re: Having a really hard time with public key authentication - help requested!

martin wrote:

What do you mean by "/.ssh/authorized_keys file"? You are on Windows, there's no /.ssh. Actually there's no /.ssh even on *nix.

I am following this guide https://winscp.net/eng/docs/guide_windows_openssh_server which clearly states that you need to create these files / folders when using windows. Please see section titled "Setting up SSH public key authentication" which lays out the steps of creating the .ssh folder and authorized_keys file in Windows.

Reply with quote

martin
Site Admin
martin avatar

Re: Having a really hard time with public key authentication - help requested!

But that article talks about C:\Users\username\.ssh, not /.ssh

Reply with quote

Advertisement

You can post new topics in this forum