[Help] [BUG] SSH key based authentication does not work

IPv4/6, Port, VPN, proxy, SSH, remote access and more.
Post Reply
storageninja
Posts: 64
Joined: 06 Aug 2025, 14:32
Netherlands

[Help] [BUG] SSH key based authentication does not work

Post by storageninja »

Hi

I noticed that ssh key based authentication does not work. The file rights are no correct in the home folder, after the below enhancements it start working.

Code: Select all

chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh/
chmod 755 ~/
TNAS logs during the debugging:

Code: Select all

Aug 22 22:46:06 TNAS sshd[34104]: Authentication refused: bad ownership or modes for file /home/<username>/.ssh/authorized_keys
Aug 22 22:46:10 TNAS sshd[34104]: Connection closed by authenticating user <username> 172.16.1.168 port 50603 [preauth]
User avatar
TMtina
TM Support
Posts: 245
Joined: 01 Nov 2022, 18:00

Re: [Help] [BUG] SSH key based authentication does not work

Post by TMtina »

Have you recently modified the permissions or ownership of this file, or moved the user's home directory? These operations might affect SSH's verification of the key file.
To contact our team, please send email to following addresses, remember to replace (at) with @:

Technical team: support(at)terra-master.com(for technical support)
Service team: service(at)terra-master.com(for purchasing, return, replacement, RMA service)
storageninja
Posts: 64
Joined: 06 Aug 2025, 14:32
Netherlands

Re: [Help] [BUG] SSH key based authentication does not work

Post by storageninja »

TMtina wrote: 23 Aug 2025, 22:20 Have you recently modified the permissions or ownership of this file, or moved the user's home directory? These operations might affect SSH's verification of the key file.
Nope not as I'm aware of, this is a default fresh installation. I installed the TOS twice and twice it did not work out of the box. Try to reproduce in your lab and I assume you see the same.
User avatar
j.mrtns
Posts: 11
Joined: 19 Sep 2021, 07:42

Re: [Help] [BUG] SSH key based authentication does not work

Post by j.mrtns »

Hello,
I was looking for a way to shutdown NAS thru ssh command from my Home Assistant installation and was facing an issue with ssh key authentification not working on my F8 Plus NAS (TOS 6.0.783).
I can confirm there seems to be a bug about files ownership in '.ssh' folder not allowing public keys installed to be correctly read, and that the solution provided by storageninja with ownership changes works for me.
Please took a look at it for future releases !
Post Reply

Return to “Network”