I have an internet camera that I would like to have send pictures over FTP to my TrueNAS server. Within my LAN everything works swimmingly. The camera connects to the TrueNAS server with the user and password I provided in the camera interface. When I try to send over the internet it fails. I have DDNS and port forwarding configured and the address resolves to the correct ip and port. 18.104.22.168:8555 and I have port 8555 forwarded to port 21 and the local ip address of TrueNAS. For some reason things seem to get blocked. I tried to connect from both from inside and out of my network. Neither work. I read a post indicating that I should not be using FTP but SFTP. I am happy to try that but I thought I would get this way to work first. I am open to other ideas to accomplish the transfer if there is a better way. TIA.
Within Services - FTP - Advanced Option set this settings
Enter the wan IP address in Masqerade Address.
Make sure the Truenas user you are using primary group is ftp , and you set the home directory of the ftp user with the correct permissions
To test use filezilla ftp client, as you can see any error messages.
On the firewall you also need to allow ports 10100 - 10199 thru
I would lock down FTP access to the wan IP address of the camera on the firewall
I am still having a timeout connection. For the camera when I connect locally, 192.168.1.142 over port 21 it works. For Filezilla I get the error below.
Status: Connecting to 192.168.1.142:21... Status: Connection established, waiting for welcome message... Status: Insecure server, it does not support FTP over TLS. Status: Logged in Status: Retrieving directory listing... Command: PWD Response: 257 "/mnt/BigdaddyZFS/Media/ftp_user" is the current directory Command: TYPE I Response: 200 Type set to I Command: PASV Response: 227 Entering Passive Mode (x,x,x,x,39,208). Command: MLSD Error: Connection timed out after 20 seconds of inactivity Error: Failed to retrieve directory listing
I am sure I had this working earlier. When I try filezilla over the internet I get the following error.
Status: Resolving address of path to ip address Status: Connecting to xx.xx.xx.xx:8555... Error: Connection timed out after 20 seconds of inactivity Error: Could not connect to server
The truenas user is ftp_user with a primary group of ftp.
I tried to connect with filezilla outside of my home network. This is the error I get:
Status: Resolving address of plex.theaddies.us Status: Connecting to xx:xx:xx:xx:45555... Status: Connection established, waiting for welcome message... Status: Insecure server, it does not support FTP over TLS. Status: Logged in Status: Retrieving directory listing... Command: PWD Response: 257 "/mnt/BigdaddyZFS/Media/ftp_user" is the current directory Command: TYPE I Response: 200 Type set to I Command: PORT 192,168,42,183,191,109 Response: 200 PORT command successful Command: MLSD Response: 425 Unable to build data connection: Operation already in progress Error: Failed to retrieve directory listing
Seems like I am getting closer but something is still wrong.
I have studied this off and on all day and it seems as though your solution is spot on perfect. I don’t know what is still the issue that keeps it from working. I always get an error at the directory listing. I believe this has to do with the passive ports not being available to the ftp server. I feel as though I have done that correctly, but I will post the information below to be sure. I would be very, very grateful for your reply. I keep reading that ftp is a terrible way to do this due to security, but all I am trying to do is get an image from a webcam every couple of minutes. It seems a nice simple way to accomplish this if I can get it to work. Thanks again.