Unable to login to SFTP in Jail from PC on same network

SlendyHDR

Cadet
Joined
Jan 25, 2022
Messages
3
hi! I'm new to TrueNAS, and I'm attempting to create an SFTP server in a Jail environment in order to transfer files within my network (for now)

I've followed the guide found here: https://www.truenas.com/docs/core/services/ftptftp/

however, this guide has unfortunately not worked for me. I'll provide screenshots as needed, and I'll attach some basic information of my jail at the bottom of this.


I feel it is important to note that I am able to connect to a normal FTP in no jail, but I'd like to have an SFTP in a Jail so the other people connecting on my network don't accidentally delete files they shouldn't.
1643142623384.png
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I've followed the guide found here: https://www.truenas.com/docs/core/services/ftptftp/

however, this guide has unfortunately not worked for me.
Of course it hasn't... that guide is talking about the FTP service that runs on the host.

Anything you do in a jail isn't going to be related to what's running in your host (with the exception of storage from the host that you have mounted into the jail).

The FTP service on the host would be able to access the jailed paths from /mnt/pool/iocage/jails/SFTPJail/root/... but that's a really illogical thing to do if all you wanted was a dataset.

To do what you're asking, you'll need to install and manually configure the FTP service inside the jail with some commands at the jail console like pkg install proftpd, then ee [B]/etc/proftpd/proftpd.conf[/B] plus a few more steps to set up the right users in the jail (not the same thing as users on your host... although you may want to make them the same name and IDs if your users will access resources on both the host and in the jail) and get the service to run automatically.

In any case, perhaps I've shown you that you're on the wrong track and maybe you can use what I said to get on the right one... or decide to do what you intend in a different way.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
@sretalla They wrote "SFTP" ... so IMHO they just need to enable SSH inside the (hopefully VNET) jail and create a user that can login.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
@SlendyHDR You need to login to your jail, e.g. if you are on the NAS host as root already via SSH:
Code:
iocage console SFTPJail


Second the jail must be a jail with "VNET" active, i.e. its own IP address.

Then in the jail as root (after the command above):
Code:
# enable SSH service
sysrc sshd_enable="YES"

# start SSH service
service sshd start

# add a user for SFTP login
adduser
 
Top