hi Christian James •
To access an FTP server on an Azure VM, you need to configure both the VM's network security group (NSG) and the Windows Firewall to allow incoming FTP traffic, specifically ports 21 and optionally passive data ports.
You also need to configure the FTP server itself, including specifying the external IP address for passive mode connections.
Here's a more details for reference:
https://stackoverflow.com/questions/18422391/how-to-set-up-ftp-on-azure-vm
- Configure the Network Security Group (NSG):
- Add Inbound Security Rule: Click "Add inbound port rule".
- Configure the rule:
- Service: Select "FTP" or "Custom" and specify port 21 (for active FTP) or port range 49152-65535 (for passive FTP).
- Priority: Leave the priority at the default value.
- Name: Give the rule a descriptive name.
- Apply the changes: Save the rule.
- Priority: Leave the priority at the default value.
- Service: Select "FTP" or "Custom" and specify port 21 (for active FTP) or port range 49152-65535 (for passive FTP).
- Configure the Windows Firewall:
- Connect to the VM: RDP into your Azure VM.
- Open Firewall Properties: Open Windows Firewall with Advanced Security.
- Create Inbound Rules:
- For active FTP: Create a new rule for port 21.
- For passive FTP: Create a new rule for the specified passive data port range (e.g., 7000-7014).
- Enable the rules: Make sure the rules are enabled.
- Configure the FTP Server (IIS) or anyother that works for you.
Important Considerations:
- Passive vs. Active FTP: Active FTP uses ports 20 and 21. Passive FTP uses port 21 for control and a higher port range for data transfer.
- Firewall Rules: Ensure that your VM's Windows Firewall rules and Azure Firewall rules (if applicable) allow both inbound and outbound traffic for FTP, especially for passive data ports.
- Static IP: It's recommended to assign a static public IP address to your VM to ensure consistent access to the FTP server.
- Troubleshooting: If you still can't connect, check the NSG rules, Windows Firewall rules, and FTP configuration. You can also use a port checker to verify that ports are open and accessible, like NMAP for example.
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.
If you have any other questions or are still running into more issues, let me know in the "comments" and I would be happy to help you.
Thank You.
Lisboa