SSH into jail from outside

Status
Not open for further replies.

nanda

Explorer
Joined
Jun 9, 2013
Messages
56
I have FreeNAS 9.1 on a network with IP 10.0.2.15.

On this system I've set up a jail, plugins1, with NAT enabled. ifconfig shows it to have IP 10.0.2.18.

Inside the jail I've also configured SSH, and a non-root user, user1.

Question 1: How can I connect to the jail via SSH from the FreeNAS prompt?

Question 2: How can I connect to the jail via SSH from the 'outer' network?

Question 3: In VirtualBox, I normally forward port 22 to 127.x.x.x:22 when faced with this problem. Is there a similar approach here?

Thanks in advance!
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
ssh user1@10.0.2.18

To connect from outside the network you would forward a port to port 22 on that same ip

Sent from my Galaxy Nexus
 

budmannxx

Contributor
Joined
Sep 7, 2011
Messages
120
Can you tell me how to do that in more detail, for FreeNAS 9.
No, because port forwarding has nothing to do with FreeNAS (any version). I found some good information on the topic here. This should get you started on your Question 2 from above. But you'll need to confirm you have Question 1 solved first. If by "FreeNAS prompt" you mean the actual console, why would you need to SSH in? You're already on the FreeNAS box. That same website I mentioned before will have details on getting SSH up and running if you're trying to connect to FreeNAS from another machine on your LAN.

Unfortunately, I don't have any experience with virtualization, so I can't help with Question 3.
 

nanda

Explorer
Joined
Jun 9, 2013
Messages
56
OK, so no real answers?

I was able to SSH to the jail from the FreeNAS prompt by the way.

The reason I'm asking is that I want to provide services from separated jail environments. SSH is a proxy for that; when it works, other ports could be forwarded in the same way.

PS. It would be ok to RTFM, but there is none for v 9.1.
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
But forwarding ports doesn't have anything to do with freenas. Think of a jail as another machine on your network

Sent from my Galaxy Nexus
 

gpsguy

Active Member
Joined
Jan 22, 2012
Messages
4,472
Nanda, do remember that 9.1 is still in beta.


Sent from my phone
 

nanda

Explorer
Joined
Jun 9, 2013
Messages
56
After reading up on jails, I suppose what I really want is to enable raw sockets for a jail, preferably from the FreeNAS 9 ui.
 

lorenzoASR

Dabbler
Joined
Nov 10, 2012
Messages
39
I have FreeNAS 9.1 on a network with IP 10.0.2.15.

On this system I've set up a jail, plugins1, with NAT enabled. ifconfig shows it to have IP 10.0.2.18.

Inside the jail I've also configured SSH, and a non-root user, user1.

Question 1: How can I connect to the jail via SSH from the FreeNAS prompt?

Just type in terminal: ssh user1@10.0.2.18

Question 2: How can I connect to the jail via SSH from the 'outer' network?Question 3: In VirtualBox, I normally forward port 22 to 127.x.x.x:22 when faced with this problem. Is there a similar approach here?

This two question should be replied togheter. If your Jails is well-configured, you can connect with SSH to 10.0.2.18 from EACH client on the same LAN.

If this is true, so you have only to add a NAT on your router!

Let's try to connect via SSH from internal LAN, and so tell me your router version, so I can give you some more help!
 

nanda

Explorer
Joined
Jun 9, 2013
Messages
56
Just type in terminal: ssh user1@10.0.2.18
Let's try to connect via SSH from internal LAN, and so tell me your router version, so I can give you some more help!


I use VirtualBox NAT:

Web user interface is on:
10.0.2.5
10.0.2.254
10.0.2.16
0.0.0.0

I can access these by SSH, port 22. This gives me access to the FreeNAS system, not the jail.

The jail is on 10.0.2.17, and accessible from the FreeNAS prompt only, using:
# ssh user1@10.0.2.17

Of course one can also use:
# jexec # csh
 

lorenzoASR

Dabbler
Joined
Nov 10, 2012
Messages
39
Ok! :D

So, have you another client connected to this LAN (not the virtualbox host) 10.0.2.0/24 ? What if ping 10.0.2.17 ?
 

nanda

Explorer
Joined
Jun 9, 2013
Messages
56
I have experimented with VirtualBox and a physical machine on a private LAN. Have never been able to access the jail from outside FreeNAS.
 

nanda

Explorer
Joined
Jun 9, 2013
Messages
56
To access FreeNAS behind the VirtualBox NAT, I use port forwarding. The same for SSH.
 

nanda

Explorer
Joined
Jun 9, 2013
Messages
56
I tried to add a host only-adapter to the FreeNAS VM, but then jails and jail creation fails; it complains that 'no default interface selected'.

But I have created a default interface. Seems like a bug to me.

I think network configuration for jails is not very intuitive.
 
Status
Not open for further replies.
Top