[Problem]: After installing lftp through rpm, running lftp huangmr: huangmr@192.168.107.132 fails to connect (lftp huangmr@192.168.107.132: ~> ls
`ls' at 0 [Delaying before reconnect: 175] or always connecting ...); but can connect through sftphuangmr@192.168.107.132.
【problem causes】:
The ftp service on 192.168.107.132 is abnormal (it should be that the ftp service is not started). Use the above command without ports to use port 21 by default (ftp protocol); follow the lftp usage method on the Internet "lftp username: password @ ftpaddress: transmission port ( Default 21) "plus port 22 or 115 will not work. Later, I found that lftp and sftp were used in combination, not directly using sftp port. You need to use lftp-uhuangmr, huangmr sftp: //192.168.107.132: 22 the way.
[Troubleshooting process]:
When this problem was raised yesterday, the following attempts were made to troubleshoot:
1. Whether the network is disconnected: The remote ftp server cannot be pinged, but can be accessed through sftp, which proves that at least the network is open, but the port or service may be restricted;
2. Whether the local and remote ftp server's ftp service is not up: Check that the local vsftpd service is up. If you can't connect to the remote ftp server, you haven't checked its ftp service. Since sftp is available, then ftp is fine ( This idea is wrong);
3. Whether the remote ftp server refuses because the local root user logs in: using normal user dop to perform lftp huangmr: huangmr@192.168.107.132 is not acceptable;
Verify after returning at night:
4. Whether to use the rpm package: Install the same rpm package on the virtual machine (vsftpd service has been started on both virtual machines) and find that the connection is normal (at least it can prove that the rpm package and the installation method are available, so Suspect that the existing network service is inconsistent with the virtual machine environment);
5. Whether the firewall, SELinux and other issues cause: After starting SELinux on virtual machine A (vsftpd service is started), there is no problem connecting virtual machine B from virtual machine A, and if B is also running SELinux, the connection fails (only Verify that starting SELinux on the peer end will affect the lftp connection, but it still cannot be proven that the problem on the live network is caused by the problem, and you cannot connect to the peer server and try SELinux off !!!).
Investigation this morning:
1. Attempt to connect to ftp through ftp 192.168.107.132 and found that ftp timed out: It is estimated that the peer ftp service has not started;
2. Query the method of using lftp. If you do not add a port, the default port 21 is to use the ftp protocol. Through the previous troubleshooting, the ftp service is not actually started, so it is no longer connected using the ftp protocol.
Using lftp, huangmr: huangmr@192.168.107.132: 22 is also unable to connect, report FEAT negotiation ..., and did not find any effective method on Baidu.
3. Since you can only use the sftp method, and Baidu lftp sftp finds the connection method lftp, huangmr, huangmr, sftp: //192.168.107.132: 22, which basically meets the first-line requirements (connect via sftp, you can directly enter the password when connecting, and Connect to ftp not by entering the password interactively).
[Process Analysis]:
1. During the process of troubleshooting, some verification methods actually cannot fully prove or eliminate a problem, such as "I think that since sftp is available, there is no problem with ftp";
2. The reason why there is not sufficient proof, or because of their insufficient knowledge of knowledge, is only a half-knowledge of ftp.
【idea】:
1. When encountering problems in the future, first list the possible causes, and start with the most probable cause. If you have only a half-knowledge, you should check the data to find a way to fully prove or eliminate the cause, and you cannot take it for granted.
2. List the possible reasons and proof methods, instead of doing it as soon as your head is hot, it is too messy and wastes time;
3. Asking others for help, sometimes after a long time, my head is still easy to get hot, but the words of others are sometimes very useful.
————————————————
Copyright statement: This article is the original article of the CSDN blogger "huangmr0610", which follows the CC 4.0 BY-SA copyright agreement. Please reprint the original source link and this statement.
Original link: https://blog.csdn.net/huangjin0507/article/details/49467467
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.