How to login to jail via SSH?

Status
Not open for further replies.

Dmitry Nevozhay

Dabbler
Joined
May 30, 2014
Messages
30
Hi!
I failed to connect directly to plugin's jail with ssh, without "jexec N tcsh"...
So I enabled sshd in jail's /etc/rc.conf:
echo 'sshd_enable="YES"' >> /etc/rc.conf
And then changed jail's /etc/ssh/sshd_config to match the host's one:
PermitRootLogin yes
PubkeyAuthentication yes
PasswordAuthentication yes
And started service:
service sshd start

But when i try to login to Jail_IP:22 as root with PUTTY, it fails
login as: root
Using keyboard-interactive authentication.
Password for root@sabnzbd_1:
Access denied

I use root pasword from host's root user.
What's my mistake?
And how to resolve this issue?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi!
I failed to connect directly to plugin's jail with ssh, without "jexec N tcsh"...
So I enabled sshd in jail's /etc/rc.conf:
echo 'sshd_enable="YES"' >> /etc/rc.conf
And then changed jail's /etc/ssh/sshd_config to match the host's one:
PermitRootLogin yes
PubkeyAuthentication yes
PasswordAuthentication yes
And started service:
service sshd start

But when i try to login to Jail_IP:22 as root with PUTTY, it fails
login as: root
Using keyboard-interactive authentication.
Password for root@sabnzbd_1:
Access denied

I use root pasword from host's root user.
What's my mistake?
And how to resolve this issue?
root in the jail doesn't have a password unless you set one.

I personally have ssh enabled on my freenas host (and not on my jails), then use 'jexec # csh' to login to whatever jail I need to get to.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
To set a password for the root user in the jail use jexec to get a jail shell then type 'passwd root' then enter the new password.
 

Dmitry Nevozhay

Dabbler
Joined
May 30, 2014
Messages
30
Thanks, guys! I've set the password for root in the jail, and it's working now.
 

neiklot

Cadet
Joined
Jul 31, 2016
Messages
9
root in the jail doesn't have a password unless you set one.

I personally have ssh enabled on my freenas host (and not on my jails), then use 'jexec # csh' to login to whatever jail I need to get to.

Thanks a lot!! :)
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
You know, when you make a jail, you can highlight the jail in the GUI, and just click the little shell icon at the bottom. No need to jexec into anything. And you can do "passwd" right there.
 
Status
Not open for further replies.
Top