SSH jail

Status
Not open for further replies.

wounn

Cadet
Joined
Jan 28, 2015
Messages
6
Hi,

I'm trying to access with ssh to a jail.
I saw a lots of videos on youtube, but i cant do the way he does. He use the shell of freenas and modify some files with nano, but to save the file i need to do the ctr+X command.
I'm using the google chrome and the browser didnt send that command to the shell.

Sorry about my english :(
 

Gonzalo

Patron
Joined
Nov 29, 2014
Messages
457
Hi Wounn,

You should try to use a SSH client (in Windows, you can try PuTTY) instead of the browser. Connect to the IP and port configured on FreeNAS (WebUI -> Services -> SSH). For more information, you can read the oficial documentation.

Regards.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I can think of a few possible solutions:
  • Use SSH to connect to your server, rather than the shell from the web GUI--this can be configured directly from the web GUI without the need for the CLI
  • Learn to use another editor like vi
  • If the edits just require adding something to the end of a file, you can do echo sometext >> /path/to/file
 

wounn

Cadet
Joined
Jan 28, 2015
Messages
6
Hi Wounn,

You should try to use a SSH client (in Windows, you can try PuTTY) instead of the browser. Connect to the IP and port configured on FreeNAS (WebUI -> Services -> SSH). For more information, you can read the oficial documentation.

Regards.
But the jail refuse the ssh connection by default options, and i need to enable the ssh on the jail.
I can acess with ssh to the freenas machine, but i cant acess to the jail.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
SSH to the FreeNAS box. jls. Find the number of your jail. jexec # csh. Do whatever you need to do in the jail.

Edit: You can use this technique long-term; you may not need to enable ssh on your jails at all.
 

wounn

Cadet
Joined
Jan 28, 2015
Messages
6
I can think of a few possible solutions:
  • Use SSH to connect to your server, rather than the shell from the web GUI--this can be configured directly from the web GUI without the need for the CLI
  • Learn to use another editor like vi
  • If the edits just require adding something to the end of a file, you can do echo sometext >> /path/to/file

the shell refuse the connection by default.
i'm trying to do this: but when he does the CRL+O, works for him, but not to me because my browser dont send the command.
the vi its the same thing....
 

wounn

Cadet
Joined
Jan 28, 2015
Messages
6
SSH to the FreeNAS box. jls. Find the number of your jail. jexec # csh. Do whatever you need to do in the jail.

Edit: You can use this technique long-term; you may not need to enable ssh on your jails at all.
i do this command where? in the shell of the jail? sorry :(
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
You do not need to ssh to the jail. You do not need to ssh to the jail. You do not need to ssh to the jail. You do not need to ssh to the jail.

SSH to the FreeNAS box. Not to the jail. To the server itself. Log in as root--either ssh as root (if enabled), or ssh as another user and su to root.

At the command prompt, type 'jls'. You'll get something that looks like this. It may have more or fewer entries, but it will have at least one if you have a jail running:
Code:
[root@freenas2] ~# jls
  JID  IP Address      Hostname                      Path
    1  -               crashplan_1                   /mnt/tank/jail/crashplan_1
    2  -               plexmediaserver_1             /mnt/tank/jail/plexmediaserver_1
    3  -               transmission_manual           /mnt/tank/jail/transmission_manual
    4  -               virtualbox2                   /mnt/tank/jail/virtualbox2
    11  -               sonarr                        /mnt/tank/jail/sonarr


Find the JID (the number) of your jail. At the command prompt, type 'jexec (whatever the number is) csh'. You'll notice that your command prompt changes from "root@freenas" to "root@jailname". You're now in your jail, and can do whatever you need to do in there. If you like, you can configure the jail to accept ssh connections directly to the jail--but you don't need to do that.
 

PenalunWil

Contributor
Joined
Dec 30, 2013
Messages
115
And of course you should use vi. None of that nano or emacs nonsense.

Hi anodos

What about vim? And is vi better than putty?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I hope to god so... LOL.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yes, but only when using the Linux CLI to remotely reticulate proxied filesystem splines on ad-hoc networks.

Hey, I could be a scriptwriter for csi cyber!

C-C-C-C-Combo-breaker!
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Yes, but only when using the Linux CLI to remotely reticulate proxied filesystem splines on ad-hoc networks.

Hey, I could be a scriptwriter for csi cyber!

I fully expect a revelation in a few years that CSI (all of them) have been actually randomly-generated scripts created by a few lines of C code and a crummy random number generator.
 
Status
Not open for further replies.
Top