Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Ftp: connect: no route to the host

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

FTP protocol has two working modes: PORT mode and PASV mode, which means active and passive in Chinese.

The PORT (active) connection process is that the client sends a connection request to the server's FTP port (default is 21), and the server accepts the connection

Establish a command link. When data needs to be transmitted, the client uses the PORT command on the command link to tell the server, "I have opened the XXXX port."

So the server sends a connection request from port 20 to the client's XXXX port, establishing a data link to transmit data.

The PASV (passive) connection process is that the client sends a connection request to the server's FTP port (default is 21), and the server accepts the connection

Establish a command link. When data needs to be transmitted, the server uses the PASV command on the command link to tell the client, "I have opened the XXXX port."

So the client sends a connection request to the server's XXXX port and establishes a data link to transmit data.

Operating system: centos7.3

Client login

[root@test] # ftp 113.142.57.158

Connected to 113.142.57.158 (113.142.57.158).

220 (vsFTPd 3.0.2)

Name (113.142.57.158:root): posftp

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

Ftp > ls

227 Entering Passive Mode (192, 168, 1, 84128204)

Ftp: connect: no route to the host

Ftp > passive

Passive mode off.

Ftp > ls

200 PORT command successful. Consider using PASV.

150 Here comes the directory listing.

Drwxr-xr-x 2 1001 100 4096 Nov 28 13:12 letposexe

-rw-r--r-- 1 1007 15523840 Apr 26 13:53 letposexe.tar

226 Directory send OK.

Ftp >

Server modification:

Set passive mode port

Echo'

Pasv_enable=YES

Pasv_min_port=41000

Pasv_max_port=42000

'> > / etc/profile

-restart the service

Systemctl restart vsftpd.service

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report