FTP server behind pfsense
I have installed a FTP (vsftpd) server on a linux server in my LAN network and i would like to access it from the WAN server but i does'nt work :(
The server should be reachable via SFTP (port 22) from the WAN network, here is my configuration of port fowarding: ( i made it from "Firewall->Rules->WAN)
When i try to access it with with WinSCP via WAN it keep searching for the host without finding it. I used the configration in https://doc.pfsense.org/index.php/FTP_without_a_Proxy for the conf of vsftpd but i have a question:
Can the the vsftpd server be reachable when with the configuration i made via "Firewall-> Rules" or should i add something in " Firewall->NAT->1:1" and if yes, what should i add ? Should i erase my current conf and create a new one in firewall->NAT ?
Thank you :P
chpalmer last edited by
22 is SSH.. Is it possible you have SSH (Secure Shell Server) enabled on your pfSense?
I have enabled the secureshell now i can access the server with the Public IP from the LAN but not from the WAN :(
I ama pretty sur i should add someting in "Firewall->NAT->1:1" but i don't know how to do it ;( i thought the configuration i have psoted would be enough :(
You do not need any 1:1 NAT to do a dead simple port forward. You are doing it wrong - use Firewall - NAT - Port Forward, not Firewall - Rules.
so your running your control channel for ftp on 22?? SSH or sftp?? WTF?? Makes ZERO sense to do that.. vsftp is not sftp server.. its a ftp server..
So which is it do you want to run ftp or ftps/ftpes (ftp using ssl) or do you wan to run sftp - which secure ftp using ssh.. Part of ssh, you do not need to install the ftp server vsftp to do that.
If sftp then simple as port forward 22. If then its a bit more complicated - are you clients active or passive. Are you going to do it over ssl then the common port is 990..
Hello doktornotor & chpalmer,
Thank you for your feedback, i am going to focus on ftp instead of sftp which looks easier.
Thank for your help, i will get back to you when i will be available.
Not sure where u got idea ftp is easier? In ftp there are multiple ports involved control and data and data changes direction if active or passive much more involved in getting to work through nat firewall while sftp is 1 port
Hi there again,
I have made progess regarding my FTP server but it still doesn'work. I have erased my old configuration and add this conf:
First rule "FTP passive port forward":
Second rule "FTP port forward 4101":
The FTP works normally in the lan when the followwng line is uncommented:
"MasqueradeAddress x.x.x.x" (where x.x.x.x is the public adress of my pfsense).
As soon as i uncomment it i cannot access my FTP anymore with his private IP adress from the LAN or with the public adress of my pfsense from the WAN, i have the same error message with winscp or filezilla client:
In the log of proftpd i see the messages:
"USER ftpuser: Login successful"
"FTP session opened"
In the log of winscp i see:
. 2017-03-07 13:15:22.133 Using FTP protocol.
. 2017-03-07 13:15:22.133 Doing startup conversation with host.
2017-03-07 13:15:22.196 PWD
< 2017-03-07 13:15:22.212 257 "/" est le répertoire courant
. 2017-03-07 13:15:22.212 Getting current directory name.
. 2017-03-07 13:15:22.383 Retrieving directory listing…
2017-03-07 13:15:22.383 TYPE A
< 2017-03-07 13:15:22.399 200 Type paramétré à A
2017-03-07 13:15:22.399 PASV
< 2017-03-07 13:15:22.415 227 Entering Passive Mode (x,x,x,x,234,144). (NOTE: x.x.x.x is the public addressof pfsense)
2017-03-07 13:15:22.415 MLSD
. 2017-03-07 13:15:22.415 Connecting to x.x.x.x:60048 ... (NOTE: x.x.x.x is the public addrress of pfsense)
. 2017-03-07 13:15:37.811 Timeout detected. (data connection)
. 2017-03-07 13:15:37.811 Could not retrieve directory listing
- 2017-03-07 13:15:37.982 (EFatal) Lost connection.
I have the same thing in filezilla client so i think the problem doesnt come from the ftp client
Here is my proftpd config:
DisplayChdir .message true
PassivePorts 60000 60050
MasqueradeAddress x.x.x.x (the public IP adress of my pfsense)
<ifmodule mod_dynmasq.c=""># DynMasqRefresh 28800</ifmodule>
Umask 022 022
#SetEnv TZ :/etc/localtime
<ifmodule mod_quotatab.c="">QuotaEngine off</ifmodule>
<ifmodule mod_ratio.c="">Ratios off</ifmodule>
<ifmodule mod_delay.c="">DelayEngine on</ifmodule>
<ifmodule mod_ctrls.c="">ControlsEngine off
<ifmodule mod_ctrls_admin.c="">AdminControlsEngine off</ifmodule>
<limit login="">DenyGroup !ftpuser</limit></anonymous>
Dude, when you passive ports range is 60000 60050 then kindly do NOT redirect 6000 - 6050. WTF.
Thank you for you kind advice, indeed the port redirection was not correct, i modify it and its working now.
Thanks a lot WTF bro ;)
You are welcome.
P.S. FTP still sucks, definitely would use SCP/SFTP whenever it's a viable alternative. :P