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

Discussion in 'Configuration' started by ProtoSD, Jul 31, 2011.

  1. Offline

    ProtoSD FreeNAS Guru

    Member Since:
    Jul 1, 2011
    Messages:
    3,358
    Message Count:
    3,358
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Leaving FreeNAS
    ProtoSD, Jul 31, 2011

    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.
  2. Offline

    twodave

    Member Since:
    Sep 3, 2011
    Messages:
    4
    Message Count:
    4
    Likes Received:
    0
    Trophy Points:
    0
    twodave, Sep 3, 2011

    The steps for OSX are the same as the steps for any other *nix system. Just open up terminal and type:

    Code (text):
    1. $ ssh user@hostname
  3. Offline

    raymod2

    Member Since:
    Dec 14, 2011
    Messages:
    17
    Message Count:
    17
    Likes Received:
    4
    Trophy Points:
    3
    raymod2, Dec 15, 2011

    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).
  4. Offline

    ProtoSD FreeNAS Guru

    Member Since:
    Jul 1, 2011
    Messages:
    3,358
    Message Count:
    3,358
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Leaving FreeNAS
    ProtoSD, Dec 15, 2011

    You're right Raymod2! Thanks for catching that and posting! :)
  5. Offline

    gcooper

    Member Since:
    Sep 23, 2011
    Messages:
    416
    Message Count:
    416
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Former iXsystems Software Developer
    gcooper, Jan 4, 2012

    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.
  6. Offline

    Lucien

    Member Since:
    Nov 13, 2011
    Messages:
    27
    Message Count:
    27
    Likes Received:
    0
    Trophy Points:
    1
    Lucien, Jan 21, 2012

    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?

Share This Page