SOLVED Cant set up keys using Putty and PuttyGen with SSH

Mashly

Dabbler
Joined
Nov 14, 2015
Messages
33
Hi,

I had this working before where I followed this guide to set up password less login.

https://forums.freenas.org/index.ph...ows-clients-using-putty-on-freenas-9-3.34893/

I had it working before and was worried when I did a factory reset and it was still letting me login. So I removed the authorized_keys file from .ssh and recreated the keys. Now every time I login it gives me the error: Disconnected: No supported authentication methods available (server sent: public key) and in the putty window it says server refused our key.

I have re-done this twice and checked that the keys match and they do, so does anyone know what I am doing wrong and how I can fix it?

Thanks
 

Mashly

Dabbler
Joined
Nov 14, 2015
Messages
33
I think you are right about the permissions as I have re-set it up for root and it works with the 600 permissions on authorized_keys. As soon as I add the key to a user it changes the permissions for that file to 775 and it won't let me change it back, even though I have sudo enabled and it gives me this error: chmod: authorized_keys: Operation not permitted.
 

Mashly

Dabbler
Joined
Nov 14, 2015
Messages
33
Your good, haha. Yes I do.

So I guess change the permissions to a linux type and then change it.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,464
So I guess change the permissions to a linux type and then change it.
That would do it. It's probably possible with Windows permissions too, but it would need to be managed from a Windows client (and I can't help you there; I don't have Windows clients on my network).
 

Mashly

Dabbler
Joined
Nov 14, 2015
Messages
33
I have tried it and it doesn't seem to work. But at least I know what the problem is now.

Thank you so much for your help, I have been pulling my hair out for hours over this.
 

reudant

Cadet
Joined
Mar 5, 2016
Messages
3
What are the permissions on .ssh and authorized_keys?
I was having the same issues as the user at the top of this post: Disconnected: No supported authentication methods available (server sent: public key) and in the putty window it says server refused our key.
I don't understand what you mean by permissions on .ssh and authorized_keys. Is this something that needs to be changed in Freenas or Windows? I couldn't find anything regarding those permissions in Freenas. I'm running the latest Freenas 9.10 and Windows 10.
 
Joined
May 23, 2019
Messages
1
Working with PuTTY’s Public Key Format
You can click Save public key as well, but take note: The format PuTTYGen uses when it saves the public key is incompatible with the OpenSSH authorized_keys files used for SSH key authentication on Linux servers.

If you need to see the public key in the right format after the private key has been saved:

  1. Open PuTTYgen.
  2. Next to Load an existing private key file, click the Load button.
  3. Navigate to the private key in your file system and select it.
  4. Click Open.
  5. The public key will be redisplayed again in the appropriate format.

Now that you have your generated key pair saved on your computer and ready to use, you can:

ref url http://www.puttygen.com/winscp
 

ctphillips

Dabbler
Joined
Apr 20, 2012
Messages
12
Thanks AaronWright32! I've been going nuts for about an hour trying to figure out this issue. You're the first person I've found in that time to identify the heart of the issue. After upgrading from FreeNAS 11.1 to 12.0-U7, my Putty SSH access stopped working. This turned out to be an issue with the key length, so I generated new keys. The new keys didn't work either - until I found your post anyway. Thanks again.
 
Top