Send file via sftp from external server to TrueNAS

iocenter

Cadet
Joined
Jan 18, 2021
Messages
4
Software
TrueNAS-12.0-U1.1

Goal
Allow external server to send files via sftp via the internet to TrueNAS. The files must be available on Windows via SMB share with read/write/delete permissions.

What I did so far
First of all I got half-way there but I didn't take notes last night so I might forget to list an important detail!

Add dataset
TrueNAS - Storage - Pools - Add dataset to pool. Permission are set to my user account.

Add jail
Create jail and mount storage to new dataset.
Open shell, create new user, install sftp. The created user is different to the user set in the dataset permissions.

Send file via sftp from external server
Code:
sftp -P <port number> myuser@subdomain.dns.com
# put file


The file is transferred over the wire and I can see/open/edit it when using the shell, i.e. TrueNAS - Jails - my jail - Shell.

What does not work

  • Files created in the shell or transferred via sftp do not show up in Windows 10 via SMB share. Files created on Windows 10 in the network attached drive do not show up when using the shell in TrueNAS in the jail. But these created files are available on different Windows 10 machines. So the transfer of files to and from TrueNAS works.
  • ssh'ing/sftp'ing into the jail does work fine for the first few tries, or the first few minutes until it throws an error:
    ssh: connect to host myuser@subdomain.dns.com port <port number>: Connection refused
    Restarting the jail fixes the issue but it would be nice if this would not be necessary. Otherwise I couldn't trust that files are always retrieved.

Finally is this route a good solution/best practice? Are there other routes worth exploring? I thought about setting up a VM inside TrueNAS but I think this adds too much overhead for a simple file transfer. It will need a lot more resources than necessary IMO. Thanks!
 

iocenter

Cadet
Joined
Jan 18, 2021
Messages
4
The folder shows up on Windows SMB share now. It might be because I updated the mounting point.
 
Top