New to TrueNAS but not SSH - Key Login Problem

Hello all, first time poster. I’m hoping I’m not breaking decorum or conventions and am in the right place.

I’ve been a linux user for a long time, and decided to get my drives out of my server and build a dedicated NAS (replacing a failing drive in a server crammed with stuff is… not fun).

I’m a fan of ZFS and after test driving a few things I gave truenas the green light on my NAS.

I’ve set it up and it’s working pretty good, even if I’m used to command line in linux much more than a UI.

However, I’ve found an issue in 26.00Beta3 that is stumping me. I can’t get ssh keys to work. Password login works fine, but out of all the things I’ve tried, my ssh key results in me@xxx.xxx.xxx.xxx: Permission denied (publickey).

I turn on password and can ssh to the machine without a problem.

SSH service is on, using defaults. Here is the user setup:

SSH has always been easy for me, just ssh-keygen, copy xxx.pub key text, put it where it needs to be. I can’t post a pic here for some reason, but I put the pub key where it instructs to when setting up the user for ssh.

I’ve tried the chmod on my home dir, .ssh, and authorized_keys.

chmod g-w /home/your_user
chmod 700 /home/your_user/.ssh
chmod 600 /home/your_user/.ssh/authorized_keys

I validated that the UI saved the correct key in the authorized_keys.

I’m pretty stumped here. SSH is simple.. most of the time. But this one is bothering me, since I plan on running a small git instance on this nas, and will need ssh to properly use it.

I swear I must be missing something stupid, but can’t seem to figure it out.

Thank you to anyone that can offer help here. I’ve exhausted a couple of days of free time trying to sort this out.

Use the gui - drop in the public ssh key in edit user

Thanks for the tip, unfortunately I have done that already with no luck. Its been a bit of a pain at this point.

If you go to Credentials, Users in the GUI, is SSH Access allowed in the Access section? Hoping same section on Beta 3, looking at 25.10.6 screens

1 Like

It looks similar. I added ssh access to my user account in credentials section. Have the choice of enabling password (not recommended) or not checking it and default to ssh keys.

Enabling password works fine, disabling password and using the pub key from my client machine doesn’t work. Access denied public key.

This bugs me. Its a clean install of 26.00beta3 too.

the other way I would try is “ssh-copy-id” command (if available of course)

run
ssh -vvv your_user@truenas.local

to debug - that might help also

2 Likes

Any reason you’re using a beta release?

Why not report this as a potential bug and try a stable lower version.