How To get to the Command Line (CLI) or shell

Status
Not open for further replies.

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
There are 2 ways, the easiest is from the console (the screen you see when you boot).
The other way is using a method called ssh.

The first way, at the console, you'll see a 'list' black & white text with choices 1-11, like seen just below. Choose #9 and [Enter] and you'll see the shell prompt which looks like:
% <--This is where you'll type your commands.

console-1.jpg


The other method requires a client program, which depends on whether you're running Windows/MacOS/Linux. See this link for a comparison of client programs you can use:
Comparison_of_SSH_clients

For Windows a program called Putty is pretty popular, it's here:
Putty

For Mac, I'm not sure what is preferred, but there's this one:
Rbrowser

For Linux, from the command line/terminal you would just type:
ssh -l admin IP-address for example 'ssh -l admin 192.168.1.100'
and enter the password which is 'freenas' unless you've changed it. (You should)

Once you install one of the client programs, you just need to look for the place to enter the IP address of your FreeNAS system, enter the username 'admin', and tell it to connect. After it successfully connects, you should also see the % prompt.

If you're using ssh, you may need to gain root privileges by typing 'su' to run some commands. When you type 'su' and press enter, you'll need to know the root password which you can set from the GUI by going to Account -> Users -> View All Users and looking for 'root' and clicking on the button 'Change Password'. The default password for both 'admin' and 'root' is 'freenas'.

Please give me feedback in case I missed something so I can update this.
 

twodave

Cadet
Joined
Sep 3, 2011
Messages
4
The steps for OSX are the same as the steps for any other *nix system. Just open up terminal and type:

Code:
$ ssh user@hostname
 

raymod2

Dabbler
Joined
Dec 14, 2011
Messages
15
You forgot to mention that you have to enable SSH in the web GUI:

Services->Control Services->SSH->(turn on)

You also need to click on the wrench icon to access the SSH settings and check "Login as Root with password" if you want to login is root (otherwise it will reject attempts to login with that account).
 
G

gcooper

Guest
Back in 8.0.1-RELEASE, it was changed s.t. the root password was disabled by default. You need to set the admin/root password in the GUI before you can login with the root password.

Recommending root-ssh is probably not a wise idea though. It goes against the grain of a secure Unix platform. su exists for this reason, but you a) need to be in wheel [on FreeBSD/Linux/Solaris; staff on OSX] and b) you need to know the root password.
 

Lucien

Dabbler
Joined
Nov 13, 2011
Messages
34
For Linux, from the command line/terminal you would just type:
ssh -l admin IP-address for example 'ssh -l admin 192.168.1.100'
and enter the password which is 'freenas' unless you've changed it. (You should)

I've tried this but am not able to login as admin. I created an account for a user and was able to log in as them though. Does the "login as root" affect logging in as admin as well? Or do we need to explicitly need to create an "admin" user account in the GUI to be able to login as admin via ssh?
 
Status
Not open for further replies.
Top