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.

28 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.
    Thanks.

  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.
    JMW
    UK

  15. Frode Says:

    Thanks for this thread. Along with this YouTube clip It helped me get connected: http://www.youtube.com/watch?v=lwHktjugAYM#t=48

    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 http://shades-of-orange.com/post/2015/01/14/Setting-up-freeSSHd-to-Connect-to-its-SFTP-Server-Using-SSH-Public-Key-Authentication.

    Cheers!

  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: http://shades-of-orange.com/post/2015/01/14/Setting-up-freeSSHd-to-Connect-to-its-SFTP-Server-Using-SSH-Public-Key-Authentication#1)? 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?

    thanks
    oldunixguy

  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

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: