ftp on the windows commandline

Status
Not open for further replies.

murphyk

New Member
Prime Account
Messages
12
Reaction score
0
Points
1
Hi,

I'm trying to upload files using ftp on the commandline with no luck. I can connect and login to the server successfully but after i issue a put command the console just sits there and hangs until the connection times out. Example:
ftp> put test.txt
200 PORT command successful
425 Could not open data connection to port 52228: Connection timed out

I have no trouble uploading files via FileZilla but would like to be able to do it from the commandline as well.

Any help/advice would be much appreciated.

Thanks

murphyk
 

ichwar

Community Advocate
Community Support
Messages
1,454
Reaction score
7
Points
0
You should be using port 21. Not port 52228. ;)
 

murphyk

New Member
Prime Account
Messages
12
Reaction score
0
Points
1
Thanks for such a speedy reply. The port number is set to 21 on initial connection. It seems after i issue the put command the port gets changed? Even if i do an "ls" the same thing happens:

ftp> open <SERVER>.com 21
Connected to <SERVER>.com.
220---------- Welcome to Pure-FTPd [TLS] ----------
220-You are user number 5 of 50 allowed.
220-Local time is now 17:46. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 3 minutes of inactivity.
User (<SERVER>.com:(none)): <MY_FTP_USER_NAME>
331 User <SERVER>.com OK. Password required
Password:
230-User <MY_FTP_USER_NAME> has group access to: murphyk
230 OK. Current restricted directory is /
ftp> cd public_html/
250 OK. Current directory is /public_html
ftp> pwd
257 "/public_html" is your current location
ftp> ls
200 PORT command successful
425 Could not open data connection to port 52775: Connection timed out
 

ichwar

Community Advocate
Community Support
Messages
1,454
Reaction score
7
Points
0
ftp> open <SERVER>.com

What exactly did you put in <server>?
 

Smith6612

I ate all of the x10Pizza
Community Support
Messages
6,517
Reaction score
48
Points
48
I believe the non-port 21 issue is taking place due to Passive FTP mode, if I'm not mistaken.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
I believe the non-port 21 issue is taking place due to Passive FTP mode, if I'm not mistaken.

Either passive or active mode might be involved, combined with a firewall or NAT on the client's side. Port 21 is only used for control messages. Port 20 on the server is used for data (such as directory listings) under active mode. Port 52775 might be on the client side under active mode or server side for passive mode. OP: try passive mode if not already, then try it with any firewall temporarily disabled. If you want to know more, read about active vs. passive mode on Slacksite.
 

Jarryd

Community Advocate
Community Support
Messages
5,534
Reaction score
43
Points
48
Hello, your best option would be to download a FTP program such as Filezilla, it would make your life a lot easier in the long run.
 

ichwar

Community Advocate
Community Support
Messages
1,454
Reaction score
7
Points
0
Hello, your best option would be to download a FTP program such as Filezilla, it would make your life a lot easier in the long run.
And in the short run too! ;)
 

murphyk

New Member
Prime Account
Messages
12
Reaction score
0
Points
1
Thanks for all the help folks. I think its a firewall issue which i am currently looking into. I use FileZilla which works fine for me. However i'd like to be able to do this from the commandline from time to time as well, especially as i wish to automate uploading content to my website , for example using a batch file that can be run via the windows task scheduler.

Edit:
Confirmed it was a firewall issue. working now.
 
Last edited:
Status
Not open for further replies.
Top