Trouble establishing a key-based SSH connection

heis2201

Dabbler
Joined
Sep 10, 2020
Messages
25
Dear friends and community,
I am a newbie to Truenas and Freebsd, however, I have some experience with Linux (Ubuntu from 2006-2010 and since 2011 Fedora Linux is powering my main workstation and laptop).

As a very first step. I would like to ssh into Truenas using a key-based ssh connection. Could anyone point me to a current, useful guide? Whatever I have tried results in "Too many authentication failures". Any hint on how to do this?

Background information: I did a ssh-keygen on my client and copied the content of the freenas.pub file to to the "SSH Public Key" found in Accounts/Users/Edit, then disabled password-based auth (by setting variable to "Yes").

When attempting to connect, I use a ssh -i freenas ... to connect. No luck, "Too many authentication failures". What could be the missing piece here?
 
Last edited:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Which version of TrueNAS? If 13, then ssh-rsa keys are deprecated due to the SHA-1 hash being broken.
  1. First, generate your keys. I recommend ssh-ed25519 keys. Make sure your private key in your ~/.ssh folder is only readable by yourself, and not by your group or anyone else.
  2. On TrueNAS, enable the SSH service in the Services tab.
  3. Assuming you're logging as root, enable root logins in the SSH service.
  4. Under the Accounts->User tab, edit the root user's properties. Paste in the text of the ssh-ed25519 public key into the SSH key field. Save changes.
At this point, you should be able to SSH to TrueNAS as root.
 
Top