Sometimes (esp in amazon instance, where internal IP mapping is used, when you connect to a domain created through ftp, you will most likely encounter problem "ls command timed out" when listing the files after logging in)
The work around for this is to add the following in proftpd.conf file.
MasqueradeAddress xx.xx.xx.xx
PassivePorts 60000 65000
xx.xx.xx.xx is the external IP address.
After this, if you are using amazon instance, login to aws console and then edit "Security Group" corresponding to that instance and open incoming tcp ports 60000 - 65000.
Now connect using ftp and issue ls command and it will work fine. enjoy!
Note for freaks: How you can calculate the random passive port that is connected.
After connecting to FTP and then listing the directories, you will see a line similar to the one shown below (values will differ)
Entering Passive Mode (71,7,231,187,192,32)
Here first four places indicates IP address of the server. Here it is 71.7.231.187
The next two integers are used to calculate passive port that is currently being used. It is calculated as follows. I am using the above example.
passive port=192*256 + 32
Here 192 is the second last integer and 32 is the last integer, 256 is a static value used for calculation.
Friday, July 8, 2011
227 Entering Passive Mode ftp: connect: Connection timed out proftp service
Subscribe to:
Post Comments (Atom)






0 comments:
Post a Comment