SOLVED Still can't ssh as root in my jail

gchamort

Cadet
Joined
Feb 28, 2019
Messages
6
Hi everyone,

So I searched around the internet and find various posts about "can't SSH in jails" but none seems to fix my problem :

I'm setting up a minecraft server jail following this guide : https://www.ixsystems.com/community/threads/how-to-install-minecraft-server-in-a-jail.18246/
On step "Download the jar file and place it in your jail under /srv/minecraft" I want to move the files from my laptop to the jail using scp but cant SSH access in as root, I'm stuck there.

• The guide tels to create a minecraft user : done.
• I also added this new user in wheel group as told in FreeNAS's doc "Users that require root access must also be a member of the wheel group. Enter wheel when prompted to invite user into other groups? []:"
• I allowed SSH into jail with those lines in /etc/rc.conf
> sshd_enable="YES"
also
> PermitRootLogin yes

The core issue is that trying to scp from Terminal on my laptop using minecraft@jail'sIP... into /srv/minecraft : Permission denied

• ssh as root@jail'sIP
Capture d’écran 2019-02-28 à 15.56.28.png


• ssh minecraft@jail'sIP works fine.
But then sudo su just dont let me in.
Capture d’écran 2019-02-28 à 15.31.27.png

(tried many times)

I passwd root in the jail using the FreeNAS shell in the web ui and restarted the jail after any of my changes, so i'm pretty sure about the password and stuff.

My best guest then is somewhat of a permission issue ..?

Thx for your help guys


[EDIT] : Kinda success

I should have tried that earlier, I've obviously been able to scp into /home/minecraft from my Terminal and then mv from there to /srv/minecraft using the webUI jexec (so logged as root).

BUT STILL I'd really love to know if there is an answer to the real su/root ssh problem itself.

Love.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
As a general matter, it would probably be better to have this discussion on that thread--posting there will ping users who have already been active on that thread (thus likely getting you a better answer faster), and it will also put both your problem and (presumably) its solution in the same place as the original guide, helping other users in the future. But with that said:

> PermitRootLogin yes
I'm pretty sure this needs to go into the sshd config file (/usr/local/etc/ssh/sshd.conf, IIRC), not into rc.conf.
 

gchamort

Cadet
Joined
Feb 28, 2019
Messages
6
Hi danb35, thx for your answer

As a general matter, it would probably be better to have this discussion on that thread--posting there will ping users who have already been active on that thread ...
Wellll.. that's far from stupid ( : mybad, 11/10 will do next time

I'm pretty sure this needs to go into the sshd config file (/usr/local/etc/ssh/sshd.conf, IIRC), not into rc.conf.
Ok but I got no sshd.conf at this location :/ furthermore various sources points /etc/rc.conf, like for exemple FreeNAS's doc here who's using sysrc to secure right in this particular file.

Ok, I just digged a little bit further and indeed the "PermitRootLogin yes" looks like it supposed to go in */etc/ssh/sshd_config
> did
Still can't ssh as root :(
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Still can't ssh as root :(
Did you restart sshd after making that change? service sshd restart. You might also want to make sure that it allows password logins for root; I'm not sure if that is controlled separately from allowing passwords generally.
 

gchamort

Cadet
Joined
Feb 28, 2019
Messages
6
Yep, restarted the service, then the jail, then even the whole NAS -__-

In /etc/ssh/sshd_config
> PasswordAuthentication yes
If that's what you mean
aswell as
> PermitRootLogin yes

still
Capture d’écran 2019-02-28 à 19.03.36.png
 

gchamort

Cadet
Joined
Feb 28, 2019
Messages
6
Wellllll .. it works now :eek:

I deleted and reset the jail and carefully did again all of the previous manipulations

> sysrc sshd_enable="YES"

created the minecraft user (added to wheel group)

in origin /etc/ssh/sshd_config added
> PasswordAuthentication yes

restarted jail

copy the files from laptop to NAS/Jail via minecraft user then logged from the web GUI as root to move the files inside the jail from
-> one of them overwrite the sshd_config file
in modified /etc/ssh/sshd_config added
> PermitRootLogin yes

restarted everything

I now can log as minecraft, log as root, but still cant sudo su from minecraft, but obviously I don't mind

I'm glad but frustrated not to know what was going wrong :/

Thanks a lot for your time Dan
 
Top