Disable SSH root

Status
Not open for further replies.

Charlie86

Explorer
Joined
Sep 28, 2017
Messages
71
I messed something with conf of /etc/ssh/sshd_config.

I have line

Code:
PermitRootLogin no


but I can still login as root via ssh. What I am doing wrong?

restarting ssh also did not help


Code:
root@freenas:~ # /etc/rc.d/sshd restart

Cannot 'restart' sshd. Set sshd_enable to YES in /etc/rc.conf or use 'onerestart' instead of 'restart'.

root@freenas:~ # /etc/rc.d/sshd onerestart

Performing sanity check on sshd configuration.

sshd not running? (check /var/run/sshd.pid).

Performing sanity check on sshd configuration.

Starting sshd.

root@freenas:~ # ssh-keygen -A

root@freenas:~ # 



Last thing I try was restarting FreeNAS, but I am still able to login as root via ssh.

What I am doing wrong?
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Did you uncheck the "log in as root" checkbox in the SSH service config menu?
 

Charlie86

Explorer
Joined
Sep 28, 2017
Messages
71
Thank you :) Now it is disabled.

Just one more question, what should I set as home directory of regular user now is set to
Code:
/nonexistent


and am getting error at login

Code:
Welcome to FreeNAS

Could not chdir to home directory /nonexistent: No such file or directory
 
Status
Not open for further replies.
Top