Since I enabled the FTP server on my NAS I've been getting several log alerts in my mail about failed login attempts.
This is part of the log that is sent to my email from my NAS
2016-12-26 19:26:20 alert
Failed pure-ftpd login attempt (incorrect password or inexistent username).
The details contain different IP-addresses from around the world. These seem to be unauthorized login attempts to the FTP server so I set out to limit the source IPs that are allowed to connect. Since my only reason for running the FTP server is to allow my brother to access our media library, I want only his IP address to be granted access. I found this wiki article and tried the first example, changing --dport to 21, the source and destionation IPs to match my setup. I read in another wiki entry that all scripts should start with
"#!/bin/sh" so I tried with and without this command, even though the example doesn't have that command. I changed the permissions for "nat-start" to be executable. I also removed the previous port forwarding rule allowing access to the NAS since it says in the wiki that it should be removed. However, I've left port forwarding enabled with just an empty list but I've also tried disabling it.
This is what nat-start contains at the moment (only difference is source and destination IP):
#!/bin/sh
iptables -t nat -I VSERVER 3 -p tcp -m tcp -s 111.111.111.111 --dport 21 -j DNAT --to 222.222.222.222
I've tried all of the above but still can't connect to the NAS FTP unless a port forwarding rule is created in the web GUI.
Did I miss a step?
This is part of the log that is sent to my email from my NAS
2016-12-26 19:26:20 alert
Failed pure-ftpd login attempt (incorrect password or inexistent username).
The details contain different IP-addresses from around the world. These seem to be unauthorized login attempts to the FTP server so I set out to limit the source IPs that are allowed to connect. Since my only reason for running the FTP server is to allow my brother to access our media library, I want only his IP address to be granted access. I found this wiki article and tried the first example, changing --dport to 21, the source and destionation IPs to match my setup. I read in another wiki entry that all scripts should start with
"#!/bin/sh" so I tried with and without this command, even though the example doesn't have that command. I changed the permissions for "nat-start" to be executable. I also removed the previous port forwarding rule allowing access to the NAS since it says in the wiki that it should be removed. However, I've left port forwarding enabled with just an empty list but I've also tried disabling it.
This is what nat-start contains at the moment (only difference is source and destination IP):
#!/bin/sh
iptables -t nat -I VSERVER 3 -p tcp -m tcp -s 111.111.111.111 --dport 21 -j DNAT --to 222.222.222.222
I've tried all of the above but still can't connect to the NAS FTP unless a port forwarding rule is created in the web GUI.
Did I miss a step?