Can't SSH into Jail

Status
Not open for further replies.

cake maker

Dabbler
Joined
Oct 16, 2016
Messages
13
Hi all,

I'm not too great at this, and have spent a bit of time trying. Is there a comprehensive guide to getting into a jail? I try:

Code:
sudo jexec `jls | grep -i openvpn | awk '{ print $1 }'` csh


But always get this error when I try password:

Code:
Sorry, user root is not allowed to execute '/usr/sbin/jexec 1 csh' as root on freenas


I've tried both with root (and root's password) and another user, and that user's password. Both have admin control.
Some things to note:

1. I can't ping the jail from the freenas prompt.
2. Freenas says the jail's status is: 'Running'.
3. I used the template for the jail at: http://download.freenas.org/jails/9.10/x64/freenas-pluginjail-10.3-RELEASE.tgz

Thanks for any considerations!
gc
 

Allan Wilmath

Explorer
Joined
Nov 26, 2015
Messages
99
Seems like you could simply enter the jail first, then execute the sudo command inside. Depending on how you have the jail setup, you should be able to ping it. I can ping my Plex server. If your OpenVPN is connecting outbound then it probably doesn't matter, but if it needs to accept connections, you are going to have to fix that before any connections can be made.

I would think you could enable SSH in the jail, you will have to be able to ping it first. Basically you would need to install ssh in the jail.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977

cake maker

Dabbler
Joined
Oct 16, 2016
Messages
13
Seems like you could simply enter the jail first, then execute the sudo command inside. Depending on how you have the jail setup, you should be able to ping it. I can ping my Plex server. If your OpenVPN is connecting outbound then it probably doesn't matter, but if it needs to accept connections, you are going to have to fix that before any connections can be made.

I would think you could enable SSH in the jail, you will have to be able to ping it first. Basically you would need to install ssh in the jail.

Hi thanks for the reply! Do you mean enter the jail with the GUI 'Shell' button? If I click that, a prompt opens and immediately closes.
 

cake maker

Dabbler
Joined
Oct 16, 2016
Messages
13
You don't need to install, just turn it on. It's off be default.

@cake maker what exactly are you trying to do by "getting into a jail"?

Hi Jailer, thanks for your response.

I'm trying to install openvpn, and then set it up. When you say turn on SSH in the jail, you mean that the template for the jail has SSH, but it's not enabled? And how would you turn it on if you can't get into it?
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
And how would you turn it on if you can't get into it?

You SSH in to your Freenas and then switch to the jail shell. You don't need to enable SSH in the jail unless you need direct SSH access for some reason.

jexec jail name or jid number csh
 

cake maker

Dabbler
Joined
Oct 16, 2016
Messages
13
You SSH in to your Freenas and then switch to the jail shell. You don't need to enable SSH in the jail unless you need direct SSH access for some reason.

jexec jail name or jid number csh

Thanks. It turned out to be a network problem. I deleted the jail, set it to DHCP and installed a new jail, and it worked..
 
Status
Not open for further replies.
Top