TO BE SHORT
You do not need to configure outbound rules
in Google Cloud
. In your case except port 21
you need to add additional ports, for example 50000-50500
to Google Cloud Firewall
(to add to the same rule where port 21 specified), then inWindows Firewall
(to add to the same rule where port 21 specified) and add 50000-50500
to FileZilla Settings
at the page Passive mode settings
TO BE LONG
Below is full instruction (in case if anyone need) based on Sever 2008
, because I do not use Server 2016
(everything should be very similar). Also I did not use TLS
as I do not need it. Settings below allowsFTP clients
to work via Passive mode
.
Google Cloud Settings
- Go to
VPC network -> Firewall rules
;
- Click
Create firewall rule
at the top;
- Name:
default-allow-ftp
(does not matter);
- Network:
default
(or the one you need);
- Priority:
1000
(does not matter);
- Direction of traffic:
Ingress
;
- Action on match: Allow Target tags: Leave empty (or select the one you need);
- Source IP ranges:
0.0.0.0/0
(or the one you need);
- Second source filter:
None
(or the one you need);
- Protocols and ports: Specified protocols and ports:
tcp:21,50000-50500
.
Windows Firewall Settings (taken from here. The source also shows how to setup Firewall
using Command Line
and PowerShell
):
- Login using an administrator account;
- Click Start -> Administrative Tools -> Windows Firewall with Advanced Security;
- In the left panel, Right Mouse Click on
Inbound Rules
, and then click on New Rule
;
- In the
Rule Type
section, select Port
and click Next
:
- In the
Protocol and Ports
section, select TCP
as the type of protocol and type 21, 50000-50500
in the Specific local ports
input field;
- In the
Action
section, select Allow the Connection
and click Next
;
- In the
Profile
section, select all three options and click Next
. If you wish to limit the connection to a particular profile, you can do so by selecting only the profiles you think are appropriate to your setup. For this example, we will open the port on all profiles;
- In the
Name
section, enter a descriptive name for this rule. It is recommended to list the port number in the name, so the rule is easily recognizable. Click Finish
when ready.
FileZilla Settings
- Edit -> Settings;
- In the tree select
General setting
;
- Change field
Listen on these ports:
to 21
;
In the tree select Passive mode settings
;
- Tick
Use custom port range:
, enter 5000
and 50500
;
- Select
Use the following IP
and enter your server IP (in case if it is static) or select Retrieve external IP address from:
;
Edit -> Users;
- In the tree select
General
;
- On the right side click
Add
and provide username
which you are going to use for connection. The username
does not have any relation to Windows user accounts, as FileZilla use its own user account system;
- Tick
Enable account
, and, if needed, Password
;
- In the tree select
Shared folder
;
- Add a folder you would like to make as a 'home dir' and define necessary permissions for Files and Directories.
NOTES:
FileZilla's permissions does not have any relation to Windows permission settings for your 'home dir' folder. It means if FileZilla's settings allows user to create folder\file, but permissions configured via Windows File Explorer
does not allow to do it, than user can not write any files\folders in a 'home dir'.
For Windows, users which are added to FileZilla, they are something like 'unknown', so Windows wont allow any access to 'home dir' folder at all. In order to fix it, I simply added All
profile in the security settings of 'home dir' folder.
Bonus #1
If every boot up FileZilla interface
appears, you can disable such behavior via msconfig
:
- Start -> type
msconfig
;
Startup
tab -> Untick FileZilla Server
-> Ok;
- Reboot.
Bonus #2
If linux users want to download file from ftp server using command line
:
wget ftp://username:password@server_ip_address/home_dir/file_name