Command prompt FTP hangs on any command if firewall is on Windows 10 [duplicate]
This question already has an answer here:
Command-line FTP function does not work
6 answers
I'm trying to connect to an ftp server and do numerous things from a batch file. However, on any new computer, even after allowing ports 20 and 21 in and out, it hangs when I run any command such as ls or cd with 200 PORT command successful
. It logs in fine but once I try and do something it hangs. If I turn off the firewall it works fine, however this is not ideal. What other ports or settings must I change?
windows-10 command-line firewall ftp
marked as duplicate by Martin Prikryl, Community♦ Dec 20 '18 at 13:25
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Command-line FTP function does not work
6 answers
I'm trying to connect to an ftp server and do numerous things from a batch file. However, on any new computer, even after allowing ports 20 and 21 in and out, it hangs when I run any command such as ls or cd with 200 PORT command successful
. It logs in fine but once I try and do something it hangs. If I turn off the firewall it works fine, however this is not ideal. What other ports or settings must I change?
windows-10 command-line firewall ftp
marked as duplicate by Martin Prikryl, Community♦ Dec 20 '18 at 13:25
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Thanks, The firewall keyword wasn’t in there so I hadn’t found it.
– Mark Deven
Dec 20 '18 at 12:11
How do I accept as dupe I see no option
– Mark Deven
Dec 20 '18 at 13:22
I do not. Using the app though.
– Mark Deven
Dec 20 '18 at 13:24
OK, so try the web version, once you have a chance.
– Martin Prikryl
Dec 20 '18 at 13:25
add a comment |
This question already has an answer here:
Command-line FTP function does not work
6 answers
I'm trying to connect to an ftp server and do numerous things from a batch file. However, on any new computer, even after allowing ports 20 and 21 in and out, it hangs when I run any command such as ls or cd with 200 PORT command successful
. It logs in fine but once I try and do something it hangs. If I turn off the firewall it works fine, however this is not ideal. What other ports or settings must I change?
windows-10 command-line firewall ftp
This question already has an answer here:
Command-line FTP function does not work
6 answers
I'm trying to connect to an ftp server and do numerous things from a batch file. However, on any new computer, even after allowing ports 20 and 21 in and out, it hangs when I run any command such as ls or cd with 200 PORT command successful
. It logs in fine but once I try and do something it hangs. If I turn off the firewall it works fine, however this is not ideal. What other ports or settings must I change?
This question already has an answer here:
Command-line FTP function does not work
6 answers
windows-10 command-line firewall ftp
windows-10 command-line firewall ftp
asked Dec 19 '18 at 21:55
Mark DevenMark Deven
531121
531121
marked as duplicate by Martin Prikryl, Community♦ Dec 20 '18 at 13:25
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Martin Prikryl, Community♦ Dec 20 '18 at 13:25
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Thanks, The firewall keyword wasn’t in there so I hadn’t found it.
– Mark Deven
Dec 20 '18 at 12:11
How do I accept as dupe I see no option
– Mark Deven
Dec 20 '18 at 13:22
I do not. Using the app though.
– Mark Deven
Dec 20 '18 at 13:24
OK, so try the web version, once you have a chance.
– Martin Prikryl
Dec 20 '18 at 13:25
add a comment |
Thanks, The firewall keyword wasn’t in there so I hadn’t found it.
– Mark Deven
Dec 20 '18 at 12:11
How do I accept as dupe I see no option
– Mark Deven
Dec 20 '18 at 13:22
I do not. Using the app though.
– Mark Deven
Dec 20 '18 at 13:24
OK, so try the web version, once you have a chance.
– Martin Prikryl
Dec 20 '18 at 13:25
Thanks, The firewall keyword wasn’t in there so I hadn’t found it.
– Mark Deven
Dec 20 '18 at 12:11
Thanks, The firewall keyword wasn’t in there so I hadn’t found it.
– Mark Deven
Dec 20 '18 at 12:11
How do I accept as dupe I see no option
– Mark Deven
Dec 20 '18 at 13:22
How do I accept as dupe I see no option
– Mark Deven
Dec 20 '18 at 13:22
I do not. Using the app though.
– Mark Deven
Dec 20 '18 at 13:24
I do not. Using the app though.
– Mark Deven
Dec 20 '18 at 13:24
OK, so try the web version, once you have a chance.
– Martin Prikryl
Dec 20 '18 at 13:25
OK, so try the web version, once you have a chance.
– Martin Prikryl
Dec 20 '18 at 13:25
add a comment |
1 Answer
1
active
oldest
votes
Port 21 is the control port of FTP where the FTP client connects to. Port 20 is the source port of the data connection where the FTP server connects from when using active mode (i.e. PORT
command). This means, if you really want to allow FTP active mode you need to allow connections originating from port 20 instead of allowing connection to port 20.
It is much better to not use active mode in the first place. With active mode the server connects to the client which is a nightmare if firewalls are involved and even worse if NAT is involved - i.e. practically with all internet access out of a local network from behind a typical SoHo router.
Use instead passive mode which is designed to work in scenarios where the client is behind a firewall and/or router doing NAT. If on the other hand you have both client and server behind firewall or NAT it is terribly hard or even impossible (depending on firewall and router) to establish a data connection.
In other words: FTP must die. If possible use protocols like SFTP (not FTPS) or HTTP(S) to transfer data since these protocols don't cause the nightmarish problems one gets with FTP.
OK, that sounds great but how do I do that? I see no option for passive mode on windows ftp. This has to run in a batch file. As I said I allows 21 in and out so I am allowing connections originating from pot 20.
– Mark Deven
Dec 19 '18 at 22:10
@MarkDeven: according to several sources on the internet the default ftp client on windows does not support passive mode. Use a different client then. If you need something to automate you could for example use Python with ftplib.
– Steffen Ullrich
Dec 19 '18 at 22:32
I dont know any other coding languages. It has to be in batch as that is the project assignment. You did not answer my question you just said its too much work lol.
– Mark Deven
Dec 19 '18 at 23:01
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Port 21 is the control port of FTP where the FTP client connects to. Port 20 is the source port of the data connection where the FTP server connects from when using active mode (i.e. PORT
command). This means, if you really want to allow FTP active mode you need to allow connections originating from port 20 instead of allowing connection to port 20.
It is much better to not use active mode in the first place. With active mode the server connects to the client which is a nightmare if firewalls are involved and even worse if NAT is involved - i.e. practically with all internet access out of a local network from behind a typical SoHo router.
Use instead passive mode which is designed to work in scenarios where the client is behind a firewall and/or router doing NAT. If on the other hand you have both client and server behind firewall or NAT it is terribly hard or even impossible (depending on firewall and router) to establish a data connection.
In other words: FTP must die. If possible use protocols like SFTP (not FTPS) or HTTP(S) to transfer data since these protocols don't cause the nightmarish problems one gets with FTP.
OK, that sounds great but how do I do that? I see no option for passive mode on windows ftp. This has to run in a batch file. As I said I allows 21 in and out so I am allowing connections originating from pot 20.
– Mark Deven
Dec 19 '18 at 22:10
@MarkDeven: according to several sources on the internet the default ftp client on windows does not support passive mode. Use a different client then. If you need something to automate you could for example use Python with ftplib.
– Steffen Ullrich
Dec 19 '18 at 22:32
I dont know any other coding languages. It has to be in batch as that is the project assignment. You did not answer my question you just said its too much work lol.
– Mark Deven
Dec 19 '18 at 23:01
add a comment |
Port 21 is the control port of FTP where the FTP client connects to. Port 20 is the source port of the data connection where the FTP server connects from when using active mode (i.e. PORT
command). This means, if you really want to allow FTP active mode you need to allow connections originating from port 20 instead of allowing connection to port 20.
It is much better to not use active mode in the first place. With active mode the server connects to the client which is a nightmare if firewalls are involved and even worse if NAT is involved - i.e. practically with all internet access out of a local network from behind a typical SoHo router.
Use instead passive mode which is designed to work in scenarios where the client is behind a firewall and/or router doing NAT. If on the other hand you have both client and server behind firewall or NAT it is terribly hard or even impossible (depending on firewall and router) to establish a data connection.
In other words: FTP must die. If possible use protocols like SFTP (not FTPS) or HTTP(S) to transfer data since these protocols don't cause the nightmarish problems one gets with FTP.
OK, that sounds great but how do I do that? I see no option for passive mode on windows ftp. This has to run in a batch file. As I said I allows 21 in and out so I am allowing connections originating from pot 20.
– Mark Deven
Dec 19 '18 at 22:10
@MarkDeven: according to several sources on the internet the default ftp client on windows does not support passive mode. Use a different client then. If you need something to automate you could for example use Python with ftplib.
– Steffen Ullrich
Dec 19 '18 at 22:32
I dont know any other coding languages. It has to be in batch as that is the project assignment. You did not answer my question you just said its too much work lol.
– Mark Deven
Dec 19 '18 at 23:01
add a comment |
Port 21 is the control port of FTP where the FTP client connects to. Port 20 is the source port of the data connection where the FTP server connects from when using active mode (i.e. PORT
command). This means, if you really want to allow FTP active mode you need to allow connections originating from port 20 instead of allowing connection to port 20.
It is much better to not use active mode in the first place. With active mode the server connects to the client which is a nightmare if firewalls are involved and even worse if NAT is involved - i.e. practically with all internet access out of a local network from behind a typical SoHo router.
Use instead passive mode which is designed to work in scenarios where the client is behind a firewall and/or router doing NAT. If on the other hand you have both client and server behind firewall or NAT it is terribly hard or even impossible (depending on firewall and router) to establish a data connection.
In other words: FTP must die. If possible use protocols like SFTP (not FTPS) or HTTP(S) to transfer data since these protocols don't cause the nightmarish problems one gets with FTP.
Port 21 is the control port of FTP where the FTP client connects to. Port 20 is the source port of the data connection where the FTP server connects from when using active mode (i.e. PORT
command). This means, if you really want to allow FTP active mode you need to allow connections originating from port 20 instead of allowing connection to port 20.
It is much better to not use active mode in the first place. With active mode the server connects to the client which is a nightmare if firewalls are involved and even worse if NAT is involved - i.e. practically with all internet access out of a local network from behind a typical SoHo router.
Use instead passive mode which is designed to work in scenarios where the client is behind a firewall and/or router doing NAT. If on the other hand you have both client and server behind firewall or NAT it is terribly hard or even impossible (depending on firewall and router) to establish a data connection.
In other words: FTP must die. If possible use protocols like SFTP (not FTPS) or HTTP(S) to transfer data since these protocols don't cause the nightmarish problems one gets with FTP.
answered Dec 19 '18 at 22:02
Steffen UllrichSteffen Ullrich
3,058614
3,058614
OK, that sounds great but how do I do that? I see no option for passive mode on windows ftp. This has to run in a batch file. As I said I allows 21 in and out so I am allowing connections originating from pot 20.
– Mark Deven
Dec 19 '18 at 22:10
@MarkDeven: according to several sources on the internet the default ftp client on windows does not support passive mode. Use a different client then. If you need something to automate you could for example use Python with ftplib.
– Steffen Ullrich
Dec 19 '18 at 22:32
I dont know any other coding languages. It has to be in batch as that is the project assignment. You did not answer my question you just said its too much work lol.
– Mark Deven
Dec 19 '18 at 23:01
add a comment |
OK, that sounds great but how do I do that? I see no option for passive mode on windows ftp. This has to run in a batch file. As I said I allows 21 in and out so I am allowing connections originating from pot 20.
– Mark Deven
Dec 19 '18 at 22:10
@MarkDeven: according to several sources on the internet the default ftp client on windows does not support passive mode. Use a different client then. If you need something to automate you could for example use Python with ftplib.
– Steffen Ullrich
Dec 19 '18 at 22:32
I dont know any other coding languages. It has to be in batch as that is the project assignment. You did not answer my question you just said its too much work lol.
– Mark Deven
Dec 19 '18 at 23:01
OK, that sounds great but how do I do that? I see no option for passive mode on windows ftp. This has to run in a batch file. As I said I allows 21 in and out so I am allowing connections originating from pot 20.
– Mark Deven
Dec 19 '18 at 22:10
OK, that sounds great but how do I do that? I see no option for passive mode on windows ftp. This has to run in a batch file. As I said I allows 21 in and out so I am allowing connections originating from pot 20.
– Mark Deven
Dec 19 '18 at 22:10
@MarkDeven: according to several sources on the internet the default ftp client on windows does not support passive mode. Use a different client then. If you need something to automate you could for example use Python with ftplib.
– Steffen Ullrich
Dec 19 '18 at 22:32
@MarkDeven: according to several sources on the internet the default ftp client on windows does not support passive mode. Use a different client then. If you need something to automate you could for example use Python with ftplib.
– Steffen Ullrich
Dec 19 '18 at 22:32
I dont know any other coding languages. It has to be in batch as that is the project assignment. You did not answer my question you just said its too much work lol.
– Mark Deven
Dec 19 '18 at 23:01
I dont know any other coding languages. It has to be in batch as that is the project assignment. You did not answer my question you just said its too much work lol.
– Mark Deven
Dec 19 '18 at 23:01
add a comment |
Thanks, The firewall keyword wasn’t in there so I hadn’t found it.
– Mark Deven
Dec 20 '18 at 12:11
How do I accept as dupe I see no option
– Mark Deven
Dec 20 '18 at 13:22
I do not. Using the app though.
– Mark Deven
Dec 20 '18 at 13:24
OK, so try the web version, once you have a chance.
– Martin Prikryl
Dec 20 '18 at 13:25