天天看点

在cmd中登录ftp服务器

​​http://jingyan.baidu.com/article/0bc808fc8778ee1bd485b93b.html​​

C:\Users\Administrator>ftp

ftp> open 192.168.1.135

连接到 192.168.1.135。

220 Microsoft FTP Service

用户(192.168.1.135:(none)): anonymous

331 Anonymous access allowed, send identity (e-mail name) as password.

密码:

230 Anonymous user logged in.

ftp> dir

ftp> quit

上面的密码随便输入一个邮箱就可以

退出的时候,使用quit

另外一种连接,直接ftp 172.30.115.200,然后会自动去open

遇到的问题

500 PORT/EPRT (Active Mode/Extended Active Mode) is not supported. Use PASV/EPSV instead of this

150 Opening ASCII mode data connection.

 ​​https://serverfault.com/a/245016​​

To get real information on why the connection is stuck, you're going to have to use a client that logs all of the protocol commands to see what's really happening. Theres a good site on FTP with example logs ​​here​​.

Most likely though, either

your client is behind a (dumb, or else SSL-blocked) firewall and is trying to use Active-mode FTP

your server is behind a (dumb, or else SSL-blocked) firewall and is trying to use Passive-mode FTP

If you're using SSL, the only answer is to open a range of ports (say, 10000-11000) on the firewall and configure your FTP server to force Passive mode and use that port range. If your server is using NAT you'll also need to set up the proper IP address for the server to advertise to clients, most obey whatever the server provides as the passive mode connection string and if the server thinks it's 10.1.1.1, that's what it's going to tell the clients.

If you're not using SSL, the best answer is to see if you can get your firewall to do protocol inspection for FTP. The firewall will read the traffic on port 21 and open whatever port your server wants open. This can often fix NAT addresses as well (when the firewall is also handling the NAT). You'll probably still want to force passive mode since some people don't know how to configure their FTP client properly and nearly everyone is behind a broadband router/firewall these days.

If you can't get a smarter firewall, then you'll have to stick to the "open a bunch of ports" option (or switch to a protocol that doesn't need to open a bunch of random ports like ssh's sftp).