Permission denied - Connection closed by authenticating user X

leonbusch

Cadet
Joined
Oct 24, 2019
Messages
8
Hey everyone!
I was searching for answers in this forum and else, but was not able to find any. At least not any which were able to help me out. If I have overseen something, I would appreciate it if you just send a link. Thank you!

My Problem:
For at least one day I am now trying to get this right. Until now I was always working with the root user. In the beginning of the set-up-process I did not think much about it. Now I have learned a lot, set everything up so far, the only thing which is left to do is make the other users work... which is more complicated than I thought it was.
Permissions of the .ssh directory and downwards are set and I am sure they are ok.
Root login is no problem, I even changed the public key, just to verify. It is working fine.
The other User Leon is not working. Everytime I try to connect with
Code:
ssh -p 52739 Leon@192.168.178.97
it gives me:
Code:
Permission denied (publickey)
, and on the other side in the /var/log/auth.log the error is
Code:
Oct 30 02:13:26 freenas sshd[76019]: Connection closed by authenticating user Leon 192.168.178.92 port 51976 [preauth]
.
I created a new account and inserted the working public key of the root account. Does not work either.
What else could it be if it is not the public key or permissions? Should I just reset and start from scratch?
I am not sure what else you need for analyzing the problem. I would even give someone remote access to my machine just to solve the problem if that's easier and faster!
Thank you in advance!
 
D

dlavigne

Guest
Were you able to resolve this? If not, which version of FreeNAS?
 

leonbusch

Cadet
Joined
Oct 24, 2019
Messages
8
What helped was creating a new User and apply permissions recursively. I was a little bit worried at first because of the warning, but did not have any problems until now.
I actually had the same problem again but with another User. I was able to solve the problem even without creating a new User but just by applying permissions recursively.
Additionally I changed the Home Directory Permissions, but I do not think it had something to do with the problem.
Something weird which happened is, that the ACL-Type changed from Mac to Windows. As I tried a lot solving the problem with changing permissions in shell before, I guess I modified something that I shouldn't and that's why it changed.
In a few days I will try to change the motherboard and set everything up a little more carefully.
As it works for me right now I leave it like that, but of course it would be interesting to know how that could happen.
My version is FreeNAS-11.2-U6.

Thanks for asking!
 

red2go

Cadet
Joined
Apr 18, 2021
Messages
1
I was just having this issue.

I checked in /var/log/auth.log

and was getting the following:


Code:
Apr 18 20:09:44 freenas login: login on pts/11 as root
Apr 18 20:13:05 freenas sshd[45319]: Authentication refused: bad ownership or modes for directory /mnt/tank/${USER_NAME_HERE}



The problem for me seemed to be the permissions on /mnt/tank/${USER_NAME_HERE} it was had group write permissions

The following fixed it:

Code:
chmod go-w /mnt/tank/${USER_NAME_HERE}
 
Top