SOLVED SSH Key Authentication Problems

Status
Not open for further replies.

Quinniedid

Dabbler
Joined
Oct 12, 2014
Messages
11
So far I have created a user Dave. Gave Dave a storage with permission only to him. Also under his user profile same thing made sure permissions were only him for home directory. Passed a public-key that looks like this:
ssh-rsa
AAAAB3NzaC1yc2EAAAABJQAAAgEAgNf+HNVBOWiFLpCNj7JNzxyL648EZsbhRLK+yho8lMshniWSu141Sj7A+6lhsstVIVZMI5cFz8mIHbJ2wMfisuh1fYSqKJlLCJ5gKZ8M1MyNUvPBe4y54QNfbMw2Fowo71Lugw2RMIyuZ82APKApthA3D+7yYcOnxz3ecJSrHPPJHmG2pN2RaEFCS0AvDOhoejINP7OrFSmWY80zN52dQ5jLMo7jKc9uCnQEdCO+3wY62LnrG9O1PN9RC9taF8J6/2cV+IhkIN/IHwT3s+Ygi/0rjqVHupK4op8em7cvUPEPbyaELY2epye75ZGOPN2RFIe0G0ihijpA6zazeJENorARtC3CAe4T18rkGvj9KsMOBwqbNeiUkSGgHjUOoRH55QdgyYollgB60owTpTrngYSSMeMTO8QWjZ3NIqZt4Bepcb23No8RIQyszp9LGpt+fQP2tExZb8z7yIDjg9AE3xNmNLzMSSDYCfKjdEROWR0BFJZ2V/PRLoC8DRQhcdA6CGUaKjvtfE0inT5yrnWTqH6Sdmg0mpOXtEEpcChxBqk50flHbHnNPoIKV+G8F+PjKBQB9Rsqki8lwRzF+0AqvpPlq1qHu7PqICxsNLD+HFjvipGWPqQbWDx9G4lXzGmIX0Up6OCeFdYZExdyONKYDtiCJPVOntW/v5tx
xGZiyMc=
Dave@freenas.local
Used PuTTY, choose the private key for authentication in options. Started login and ask for username. Entered username and then it gives me this:
No supported authentication methods available [preauth]
I have gone through other forums and still can't get this to work for the life of me. Any help would be much appreciated!!! Thank You!

Note: key is generated in 4096 bits if that is helpful at all
 

ljw1

Dabbler
Joined
Apr 29, 2012
Messages
16
You will need to check the ssh server config and ensure that the user is able to login as well as login with keys.
 

Quinniedid

Dabbler
Joined
Oct 12, 2014
Messages
11
I can connect to the freenas device with the username and password but not with the key. The user is part of the sftp group that I created.
295pgnr.jpg
 

Quinniedid

Dabbler
Joined
Oct 12, 2014
Messages
11
During more investigating to this problem I think it is not even sending the public key that I put into the user account. I have a 4096 bit key and the one that it is sending is a 2048 bit key? Any reason why it would not be sending the key that I entered into the user?
 

Quinniedid

Dabbler
Joined
Oct 12, 2014
Messages
11
I have figured it out a key that large is not supported as it overfills the buffer on Freenas. Went to a 2048 bit key and everything is working how it is suppose to. Thank you for your help!
Oct 13 12:02:06 freenas sshd[46522]: error: buffer_get_ret: trying to get more bytes 513 than in buffer 508
Oct 13 12:02:06 freenas sshd[46522]: error: buffer_get_string_ret: buffer_get failed
Oct 13 12:02:06 freenas sshd[46522]: error: buffer_get_bignum2_ret: invalid bignum
Oct 13 12:02:06 freenas sshd[46522]: error: key_from_blob: can't read rsa key
 
D

dlavigne

Guest
Regarding that point, please create a bug report at bugs.freenas.org and post the issue number here.
 

Quinniedid

Dabbler
Joined
Oct 12, 2014
Messages
11
Bug #6341: SSH Key Length
  • Author: Quinn Johnson
  • Status: Unscreened
  • Priority: High
  • Assignee:
  • Category:
  • Target version:
  • Seen in: 9.2.1.8-RELEASE
When using a SSH RSA key with 4096 bits length, you get the following error

Oct 13 12:02:06 freenas sshd46522: error: buffer_get_ret: trying to get more bytes 513 than in buffer 508
Oct 13 12:02:06 freenas sshd46522: error: buffer_get_string_ret: buffer_get failed
Oct 13 12:02:06 freenas sshd46522: error: buffer_get_bignum2_ret: invalid bignum
Oct 13 12:02:06 freenas sshd46522: error: key_from_blob: can't read rsa key>
 

Quinniedid

Dabbler
Joined
Oct 12, 2014
Messages
11
Okay for some reason this size of key is now accepting. I think there might have been a space some where there shouldn't be. Thanks for all your help. Now running on a SSH-RSA 4096-bit key!
 
Status
Not open for further replies.
Top