Setting up SSH

Status
Not open for further replies.

SmallGuy

Guru
Joined
Jun 7, 2013
Messages
560
Hi Sam,
Wiradog speaks about private/public key and Filezilla, I imagine you want set up a secure connexion for accessing your data: sftp connexion with key base authentication. Am I right?
Or perhaps I'm wrong and you just want a SSH connection to log on Freenas as root for troubleshooting on the "dark side" (as generaly the shell background is black, and Unix commands a foreign language).
From your home network only or from Internet too?
So you're the only one who can answer this first question:
"What exactly are you trying to achieve?"

Keep in mind that's difficult to answer/help when you don't have understand what is exactly the question.
In the other hand, I remember my situation a few months ago and my understanding of SSH: difficult to have clear vision of the thing without any experience.

[EDIT] Just realise that Wiradog start the topic and go for a router/VPN solution, and then Sam continue the discution.o_O So modify a little bit my post to match the situation.
 

Lightperfect

Dabbler
Joined
Sep 16, 2013
Messages
49
Thanks to all for the reply.

I know there is a lot things you can do with ssh.
I am still learning the basics. So first step first,
I'd like to use ssh like shell to modify my freenas files and use it as shell. That's it for now..
Thanks again
 

SmallGuy

Guru
Joined
Jun 7, 2013
Messages
560
If the files you have to modify belong to a user you have define for your share, you just need to connect thru SSH with that user/password:
-In the SSH service options configuration GUI on Freenas tick the "allow password authentication" (As a general rule, stop the service before modification)
-Clic OK at the bottom of the configuration window
-Start the SSH service
-In the client shell type in ssh user@FreenasIP
-Then it will prompt you to enter the user password
-Enter the user password
-Press Enter
-Then you are connected and are in the home directory of that user (prompt [user@freenas]).
 

Lightperfect

Dabbler
Joined
Sep 16, 2013
Messages
49
If the files you have to modify belong to a user you have define for your share, you just need to connect thru SSH with that user/password:
-In the SSH service options configuration GUI on Freenas tick the "allow password authentication" (As a general rule, stop the service before modification)
-Clic OK at the bottom of the configuration window
-Start the SSH service
-In the client shell type in ssh user@FreenasIP
-Then it will prompt you to enter the user password
-Enter the user password
-Press Enter
-Then you are connected and are in the home directory of that user (prompt [user@freenas]).

all working perfect!! thanks to all the reply!!
and bought a book for ssh to start learning more about it.
http://www.amazon.ca/SSH-Mastery-OpenSSH-Tunnels-ebook/dp/B006ZO9ULK

thanks again
sam
 

SmallGuy

Guru
Joined
Jun 7, 2013
Messages
560
Glad to heard it.
Save your time reading carefully the Freenas documentation, you will find usefull and up to date informations about SSH configuration (and other functionnalities aswell), and ask if something going wrong following it.
It's also a good way for the documentation to be corrected, if sames questions are asked many times, meaning something is missing or needing to be clarified (and that has been the case for sftp chrooting for exemple).
 

Lightperfect

Dabbler
Joined
Sep 16, 2013
Messages
49
one day i will be conquer freenas... one day...
 

jeremi

Dabbler
Joined
Dec 25, 2013
Messages
14
ther are sum prety gret dia gram of how ssh keys wort on google
and look into the hack5 ssh sery on youtube or at http://hak5.org/?s=ssh
SSH_public_private_key.gif
 

Muddro

Explorer
Joined
Oct 6, 2014
Messages
59
If anyone can help: I came home tonight and SSH stopped working. Tried rebooting and stopping and restarting the service, and now it wont even allow me to restart it. Cannot find anyone had similar problem. Any help would be appreciated.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
If anyone can help: I came home tonight and SSH stopped working. Tried rebooting and stopping and restarting the service, and now it wont even allow me to restart it. Cannot find anyone had similar problem. Any help would be appreciated.
Check /var/log/messages. Some logs should be generated that will help see what is going wrong.
 

Muddro

Explorer
Joined
Oct 6, 2014
Messages
59
Check /var/log/messages. Some logs should be generated that will help see what is going wrong.
got this:
Oct 21 01:42:23 freenas notifier: Will not 'reload' sshd because sshd_enable is
NO.
Oct 21 01:42:57 freenas notifier: Performing sanity check on sshd configuration.
Oct 21 01:42:57 freenas notifier: /etc/ssh/sshd_config: line 14: Bad configurati
on option: SendEnv^M
Oct 21 01:42:57 freenas notifier: /etc/ssh/sshd_config: terminating, 1 bad confi
guration options^M
Oct 21 01:42:57 freenas root: /etc/rc.d/sshd: WARNING: failed precmd routine for
sshd
Oct 21 01:42:57 freenas notifier: /etc/rc.d/sshd: WARNING: failed precmd routine
for sshd​
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
got this:
Oct 21 01:42:23 freenas notifier: Will not 'reload' sshd because sshd_enable is
NO.
Oct 21 01:42:57 freenas notifier: Performing sanity check on sshd configuration.
Oct 21 01:42:57 freenas notifier: /etc/ssh/sshd_config: line 14: Bad configurati
on option: SendEnv^M
Oct 21 01:42:57 freenas notifier: /etc/ssh/sshd_config: terminating, 1 bad confi
guration options^M
Oct 21 01:42:57 freenas root: /etc/rc.d/sshd: WARNING: failed precmd routine for
sshd
Oct 21 01:42:57 freenas notifier: /etc/rc.d/sshd: WARNING: failed precmd routine
for sshd​
That means you've added some invalid options to your sshd config. Best way to fix it is to delete what you have added. Specifically, something starting with 'SendEnv'
 
Joined
Oct 23, 2014
Messages
1
I am very new to FreeNAS and i was wondering if anybody could help me with ftp and ssh all i want to do is to be able to access my files from my server anywhere and i have already port forward to port 22 for ssh and port 21 for ftp but i still cannot access my server for outside my network. if anybody could help it would be appreciated?
 
Status
Not open for further replies.
Top