How to get freeSSHd public key authentication to work

I was looking for a Windows SSH server implementation to use in conjunction with Mercurial when I stumbled upon freeSSHd. Setting it up was a matter of minutes… except that I could not get public key authentication to work. After countless attempts and many a Google search I eventually solved my problem, thanks to this step by step IBM tutorial.

Unfortunately when used in non-interactive mode freeSSHd doesn’t spawn cmd.exe, which makes it unsuitable for applications that expect their remote counterparts to be on the path.


33 Responses to “How to get freeSSHd public key authentication to work”

  1. mikemurko Says:

    Fantastic thanks for the help! For me the trick was that the filename of the public key needs to be exactly = to the username for that key (with no file extension). I was used to using keys ending in “.pub”.

  2. Live Says:

    Still not working for me says

    Server refused public-key signature despite accepting key!

  3. Joel Says:

    Make sure that you use a passphrase when generating your private key. This got around the “Server refused public-key signature despite accepting key” error for me

  4. mikemurko Says:

    Not here to bash FreeSSHd, but I had *so* many problems running it on Windows. The fact that the service and the application conflict with each other means that getting it to auto-start was extremely difficult (important if your main access to the server is SSH). Also, bugs galore in terms of administration …. so I wouldn’t doubt some security bugs as well.

    My final solution was to install OpenSSH on an Ubuntu machine. Took much less time to set up. Had to punch in a few commands into the terminal, configure one config file, and I was away. Much, much, much easier. Not to mention larger community, stable product, logs are integrated into your auth.log, and tunneling worked out of the box.

    Don’t be afraid of Linux! It’s easy peasy lemon squeezy!

  5. gg Says:

    I tryed the procedure in ibm document but i get:

    Server refused public-key signature despite accepting key!

  6. Olav Says:

    Thanks, the IBM document described it very well. BUT befor it worked for me I had to restart the freeSSH Server

  7. arian Says:

    I was getting the “Server refused public-key signature despite accepting key!” message as well, however this went away after I ran FreeSSHd as an administrator. (This was on Windows 7)

    Also make sure you have a passphrase set on your privatekey.

  8. Vaiads Says:

    I would saved so much time if found it earlier :).. thank a lot, bro.

  9. John Jay Says:

    thanks arian. works for me now

  10. Martin Says:

    Run as administrator helps to the “Server refused public-key signature despite accepting key!” problem.

    • David Joffe Says:

      Thank you! That finally solved my “Server refused public-key signature despite accepting key” problem.

  11. Takuro Says:

    Or you set the public key folder other than one in C:\Program files. Probably accessing a folder in C:\Program files in the app running as not administrator redirect to somewhere else.

  12. Chandu Says:

    @mikemurko Thanks a ton. I renamed the pub file to match the user name and it worked.

  13. Jeff Says:

    As others have said “THANK YOU”. I have been struggling with how to get the SSH key to work. The link to the IBM doc was just what I needed.

  14. jmward333 Says:

    Brilliant, thank you so much. The IBM document seems to be the only one around that gives you chapter and verse on this.

  15. Frode Says:

    Thanks for this thread. Along with this YouTube clip It helped me get connected:

    I tried everything, but in the end I think what made the difference was using notepad to save the public key generated from Puttygen (don’t use Save public key button in PuttyGen) and manually restarting FreeSSHD after updating the config (It will prompt to restart the server, but it doesn’t seem to work).

  16. mythink Says:

    Thanks not even freeSHH metions how to create the public key file. I got it up and working with no passphrase since need to login automatically with no user interaction.

  17. tgaw Says:

    Thanks for your post. I found it helpful as well.

    • Mark Says:

      I have tried all the suggestions above and still get “Server refused public-key signature despite accepting key!”

  18. Karthik Says:

    It Really worked…Thanks..!!!!!!

  19. Andre Says:

    Hello, I’m hoping someone here can help out. I have everything working and I can successfully login through Putty, but the directory is C:\Windows\System32 and I can’t type anything. It’s frozen. I can successfully Putty into other servers, no problems. My home directory in FreeSSHD is set to C:\Test (I tried D:\Test as well) yet nothing works. Any ideas?

  20. Oliver Says:

    Thanks, Nicola, for writing this post and linking to the step-by-step guide from IBM. The comments are also very valuable.

    After some fiddling around with the different options and suggestions by others, I’ve put together an online guide to get public key authentication in freeSSHd to work. For anyone having problems with the setup, take a look at


  21. Oliver Says:

    @Andre: Could you verify that you’ve checked the SFTP checkbox for the login you’re using to connect to freeSSHd (as seen in this screeshot: If it’s not, that could be the cause of error.

  22. Stephane Bouniol Says:

    Folks, I think I figured it out…
    there is an odd bug in freesshd, sometimes it doesn’t take some of the changes even if your stop it.. you have to actually “unload” it and then restart it as admin…

  23. Shailesh Sutar Says:

    What about SFTP with freesshd with sshkey authentication. Cause sftp with sshkey is failing with all the said configuration in my case.
    I am running windows2012 server and client is redhat 6.4 linux box.

  24. Dan Nemes Says:

    After extensive tests the solution to the problem “Server refused public-key signature despite accepting key!” isn’t the fact that the server isn’t started as administrator or the private key doesn’t have a passphrase. The problem is with the actual freeSSHd tool which has a bug. You will have to perform the correct settings the FIRST time you start the SSH server. If you stop it and start it again you will ALWAYS have that error message “Server refused public-key signature despite accepting key!” no matter what the settings are.

    So the conclusion is: Start the SSH server only ONCE!!!!

  25. oldunixguy Says:

    I installed freesshd in win7 pro as a service because I need it to run unattended and auto start upon win7 boot.

    However, I cannot get it to save the setting changes I make. I have tried the stop-start and unload steps others have posted. I also am logged in to win7 as a user with Admin priv.

    No matter what I do when win7 restarts the freesshd starts with the default settings.

    What am I missing?


  26. David Says:

    I had a problem when trying to connect using a RSA key.
    My SSH server refused my authentication key cause when I generated it I didn’t specified the encryption level. So my key was encrypted in 2048 bits whereas my server was expecting a 1024 bits key.

    Solution :
    ssh-keygen -t rsa -b 1024

    Hope it will help

  27. magicorps Says:

    After reading all the posts, i found one pitfall causing keys to become invalid. Using clipboard sometimes produces invisible blank spaces before the key string. You might get rid of some issues by always checking your publik key to be in one line and without leading or trailing blankspaces. Ohterwise you will be prompted for reentering the key’s password without success.
    Btw. even used 2048 bits without any trouble.

    Good luck

  28. Aurun Says:

    I was facing the same problem for a week or so and i was able to crack it. Please follow the below steps to resolve the issue.

    1) Install the Freesshd application in the Data drive. (e.g. D:/Program Files/freesshd). By default application will be installed on C drive. Please change the installation path to D drive.

    2) After installation set up an user account as described in the IBM guide (e.g. test) and enter the SFTP home path which you would like to use (e.g. D:/SFTP_Root)

    3) Save all the configuration changes you have done in the freesshd server, stop the server and unload it as of now

    4) Create a local user account with the same name in the computer you have installed the freesshd server (name of the local user account: test)

    5) Ensure that full access has been given to test local user to the D:/Program Files folder

    6) Give Read/Write and Execute permissions to the test user to the path which you have given in the SFTP home path in the freesshd server (e.g. D:/SFTP_Root)

    7) Generate the private and public key pair using puttygen (1024 or 2048 bits). I used 1024 bits.

    8) Create a new file in the path D:/Program Files/freesshd with the same name as of user (e.g. test) and paste the public key generated using puttygen. Ensure that key

    is present in a single line and the file does not have any extension like .pub

    9) Save the private key to any path.

    10) Now open Winscp, load the private key under authentication field and try to connect to the server.

    It should work 🙂

  29. Aurun Says:

    Apologies – Missed one step in my original post.

    After step 9 Open Freesshd server using Run as administrator option and ensure the server is running and then open Winscp and load the private key for accessing the server

  30. Masthan Rao Yenumula Says:

    Thank you very much Aurun for your detailed steps.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: