0
votes

I have redhat linux Azure VM server through which I am trying to get directory listing from FTP server hosted on other windows Azure VM. I could connect through FTP using my local machine and filezilla and get the directory listing, But I am getting error for both active and Passive connection through my redhat linux azure VM server while using ls command.

Active connection error : ftp: accept: Resource temporarily unavailable 425 Can't open data connection for transfer of "/" 226 ABOR command successful

Passive error: 227 Entering Passive Mode (10,1,0,10,160,87) ftp: connect: Connection timed out

It looks like more of firewall issue but what kind of setting I need to change. I have also added FTP port 21 and data connection port 20 in my inbound rules.

In my firewalld rule FTP service is listed. Even all passive connection port is also added. Also I Disabled firewalld and then tried but no success.

I need to access this FTP from my PHP page to get all the files uploaded on FTP folder.

Thanks

1
Why -1 voting. I searched through all over google. Did the changes in windows IIS too. Also change the firewalld setting of linux azure but no luck.user1648204
Resolved now. It was FTP server issue. It was not allowing passive FTP connection properly. I have changed the configuration and it worked like a charm.user1648204
what was the configuration change you performed?ChrisW

1 Answers

0
votes

According to your to your issue, I do a test and succeed. My FTP server is an Azure Linux VM. My client is a local windows machine. The main steps are following:

1.Install vsftp on your Linux VM.

sudo apt-get install vsftpd

2.Edit vsftp config file.

sudo vi /etc/vsftpd.conf

3.Add these configurations .(I choose 3000 and 3001 port as data transfer ports,the address is your VM's public IP)

pasv_enable=YES
pasv_min_port=3000
pasv_max_port=3001
pasv_addr_resolve=YES

4.Restart the service.

sudo service vsftpd restart

5.Go to Azure portal and add NSG inbound rules, open 20,21 and data transfer ports .

My NSG rules

6.Using cmd to test.

test OK