SOLVED cannot SSH into FreeNAS Mini

Status
Not open for further replies.

Ir13h

Dabbler
Joined
Mar 3, 2017
Messages
32
my mini is connected to my att router via Ethernet, I can access the web ui normally. my user is an admin but not root, has a public key and is in the sshd group as well as wheel.

my ssh service settings look as follows

index.php

as best as I can tell my router is not blocking port 22. I am on the same network via wifi. There is no output in the FreeNAS footer console (related to ssh at least)

when I run ssh -vvv user@freenas I get the following output
Code:
OpenSSH_7.6p1, LibreSSL 2.6.2
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to freenas port 22.
ssh: connect to host freenas port 22: Connection refused


I have also set up an ngrok tcp tunnel on port 22, I seem to get more output when I try to use that endpoint.

Code:
OpenSSH_7.6p1, LibreSSL 2.6.2
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to tcp://0.tcp.ngrok.io port 12551.
debug1: Connection established.
debug1: identity file /Users/Mark/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Mark/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Mark/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Mark/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Mark/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Mark/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Mark/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Mark/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
ssh_exchange_identification: Connection closed by remote host
Mothership:/Us/Ma/wo/io/no/kafka % ssh -vvv root@tcp://0.tcp.ngrok.io -p 12551
OpenSSH_7.6p1, LibreSSL 2.6.2
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to tcp://0.tcp.ngrok.io port 12551.
debug1: Connection established.
debug1: identity file /Users/Mark/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Mark/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Mark/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Mark/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Mark/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Mark/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Mark/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Mark/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
ssh_exchange_identification: Connection closed by remote host

The public key is for my ~/.ssh/id_rsa file, this file does exist the permissions for it are owner can read and write others have no access
 

Attachments

  • Screen Shot 2018-02-09 at 9.17.50 PM.png
    Screen Shot 2018-02-09 at 9.17.50 PM.png
    139.7 KB · Views: 2,984
Last edited by a moderator:

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
You don't have any interfaces selected.
 

Ir13h

Dabbler
Joined
Mar 3, 2017
Messages
32
If the ssh service is running correctly and I run sockstat -4 -l | grep ssh or sockstat -4 -l | grep sshd or sockstat -4 -l | grep 22 should I see a result? because I do not, if I run sockstat -4 -l | grep www then I see port 80 being returned
 
D

dlavigne

Guest
Yes, it should show there if it's running. Do you get any errors in /var/log/messages when you try to start the SSH service?
 

Ir13h

Dabbler
Joined
Mar 3, 2017
Messages
32
thanks so I have been able to get it working but here is what it took

Code:
[root@freenas ~]# service sshd start											
Cannot 'start' sshd. Set sshd_enable to YES in /etc/rc.conf or use 'onestart' in
stead of 'start'.															   
[root@freenas ~]# sudo vi /etc/rc.conf										 
Sorry, user root is not allowed to execute '/usr/bin/vi /etc/rc.conf' as root on
 freenas.local.																		   
[root@freenas ~]# service sshd onestart


I can now login remotely woohoo but I am guessing this is not a permanent solution, I can edit rc.conf if I just don't run sudo but is this a file I should be editing by hand?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I can edit rc.conf if I just don't run sudo but is this a file I should be editing by hand?
No, it isn't. You've posted your SSH settings, but is the service turned on? Because the output from service sshd start doesn't sound like it is. It should look like this with FN11.1:
upload_2018-2-13_20-31-5.png
 

Ir13h

Dabbler
Joined
Mar 3, 2017
Messages
32
No, it isn't. You've posted your SSH settings, but is the service turned on? Because the output from service sshd start doesn't sound like it is. It should look like this with FN11.1:
View attachment 22868

thanks yes the start command did not work but the service sshd onestart command did and I can now ssh in, I am guessing if I reboot it will not come back up due to the one bit in the command onestart

also maybe I should not be starting it with root? there is an ssh user I think, should I be trying to start the process with that user or does it matter?

edit: omg that attachment might have rang a bell, I have always just clicked the service tab in the left hand menu never the top tab :oops: so I never saw that view that tells if you if its running or not, it is running now, will reboot and see if it still says its running
 

Ir13h

Dabbler
Joined
Mar 3, 2017
Messages
32
ok all appears to be well now that I know that page exists where you turn the service on and off :confused: thanks for all your help and patience
 
Status
Not open for further replies.
Top