Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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

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

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.
kjs00333

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!