Get a Quote     (408) 943-4100               TrueNAS Discord      VendOp_Icon_15x15px   Commercial Support Toggle between Light and Dark mode

Configuring SFTP

  3 minute read.

Last Modified 2022-08-05 10:43 -0400

Configuring SFTP Service

SSH File Transfer Protocol (SFTP), is available by enabling SSH remote access to the TrueNAS system. SFTP is more secure than standard FTP as it applies SSL encryption on all transfers by default.

Go to Services, find the SSH entry, and click the .

ServicesSSHOptions

Select Allow Password Authentication.

Evaluate Log in as Root with Password for your security environment: SSH with root is a security vulnerability. It allows more than SFTP transfer access. SSH with root also allows full remote control over the NAS with a terminal.

Review the remaining options and configure according to your environment or security needs.

SSH Service Options

Use the SSH screen to configure the system for SFTP. See ServicesSSH for information on SSH screen settings.

SFTP Connections

Open FileZilla or another FTP client, or command line. This example uses FileZilla. Using FileZilla, enter SFTP://TrueNAS IP, username, password, and port 22 to connect. Where TrueNAS IP is the IP address for your system, and username and password are those you use to connect to the FTP client. Or enter SFTP://'TrueNAS IP', 'username', 'password', and port 22 to connect.

Chroot is not 100% secure, but SFTP does not have chroot locking. The lack of chroot allows users to move up to the root directory. They can view internal system information. If this level of access is a concern, FTP with TLS may be the more secure choice.

SFTP in a TrueNAS Jail

Setting up a jail and enabling SSH is another way to allow SFTP access. This does not grant read access to other areas of the NAS itself.

Go to Jails > Add. Provide a name for the jail and pick a target FreeBSD image. This example uses 11.3.

Select the networking options for either DHCP or a static IP and confirm to create.

JailsAddNetworking

After the jail is created, click the expand icon > on the right-hand side of the jail to open it. Click START and open SHELL.

Create a user in the jail. Enter command adduser. Follow the prompts. Include the password and home directory location. When complete, the jail asks to confirm the credentials.

JailsShellUserAdd

Enable SSH by editing the /etc/rc.conf file. Enter command vi /etc/rc.conf or ee /etc/rc.conf depending on preference, add sshd_enable = "YES" to the file, save, and exit. Enter command service sshd enabled to enable the service (enabled vs start indicates whether sshd starts one time or on every reboot).

JailsShellEditRCConf

Using an FTP client, such as FileZilla, log in with the jail IP address and user credentials. It is like SSH on TrueNAS. Browsing to other folders and locations beyond the user home directory is possible. But unlike running on TrueNAS directly, only the components of the jail are available.

FilezillaJailConnectSFTP

Related Content