我希望我能解释清楚我的问题,因为我感到迷茫,不知道什么是真正的问题。使用Symfony2.8和,我试图连接到ftp服务器并下载文件。整个过程将只通过symfony的应用程序/控制台启动。
这是我的服务,包含了整个逻辑:
<?php
namespace xxx\Services\Import;
use Doctrine\ORM\EntityManager;
use Ijanki\Bundle\FtpBundle\Ftp;
use Ijanki\Bundle\FtpBundle\Exception\FtpException;
use xxx\Entity\Product;
use xxx
在通过命令行使用FTP服务时,我尝试检索目录列表。我得到:
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list.
> ftp: get :Connection reset by peer
有什么办法解决这个问题吗?提前谢谢。
我在ftp上列出文件有困难。我可以正确地连接,但ls似乎不起作用。启用调试模式后的输出低于--
ftp> ls
ftp: setsockopt (ignored): Permission denied
---> PORT xx,xx,xx,xx,xx,xx
200 PORT command successful
---> LIST
425 Unable to build data connection: Connection timed out
ftp> passive
Passive mode on.
ftp> ls
ftp: setsockopt (ignor
我有这个Perl脚本,在这里我想获得FTP服务器的清单。
我的理解是FTP服务器打开一个新的连接回到客户端主机上的一些随机端口发送数据。我应该以某种方式创建一个新的套接字并从中读取吗?我想不出怎么让它起作用。
#!/usr/bin/perl
use warnings;
use 5.30.0;
use IO::Socket;
my $socket = IO::Socket::INET->new("core9:21");
$socket->send("USER user7\r\n", 0);
$socket->send("PASS
我使用iptables防火墙打开了端口21,但是当我在服务器上运行nmap时,它显示ftp端口关闭了。我在linux上重新启动了service vsftpd,但没有结果。
下面是vsftpd.conf文件:
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see
我尝试了以下规则来允许FTP:
# The following two rules allow the inbound FTP connection
iptables -A INPUT -p tcp --sport 21 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT
# The next 2 lines allow active ftp connections
iptables -A INPUT -p
当我尝试使用给定的cPanel FTP配置在Filezilla中连接到我的FTP帐户时,我得到了以下错误。我已经再次检查了它,并尝试手动输入它,但我仍然收到相同的错误。
Connection attempt failed with "EAI_NONAME - Neither nodename nor servname provided, or not known".
我发现的每一件事都告诉我,我输入某些东西的方式可能有问题,但我确信我没有。我无法弄清楚这一点,我已经成功地使用了Filezilla,并使用cPanel中的FTP配置连接到了许多其他FTP帐户。
FTP设置示例:
H
我想检查我的FTP服务器是主动的还是被动的。我只有服务器名、用户名和密码。我试着改编这个链接来实现它- -
我可以使用GUI FTP客户端连接到此服务器。但是,在microsoft/windows telnet中,我使用了命令o ftp.myftp.com。但是,我得到了错误- Could not open connection to the host on port 23:connect Failed。
我如何解决这个问题,并找出我的服务器是在做主动的还是被动的ftp连接?
当我使用这种方法从ddms上传文件时,我有一个UnknownHostException:
try {
SimpleFTP ftp = new SimpleFTP();
// Connect to an FTP server on port 21.
ftp.connect("ftp://*******", 21, "*****", "*****");
// Set binary mode.
ftp.bin();
// Change to a new working directory on the FTP server.
ftp.cwd(
我想将对端口命令的支持添加到我的FTP服务器。我正在阅读RFC 959,但我不知道什么时候连接到FTP客户端是安全的。例如,考虑以下顺序:
PORT 127,0,0,1,34,34
LIST
FTP客户端是在发出PORT命令之前还是在发出LIST命令之后开始侦听?因为如果服务器试图在接收端口后立即连接到客户端,它可能会失败,因为客户机可能还没有开始侦听。
说明书上写了什么?服务器可以立即连接,还是应该等到接收到将使用数据连接的命令时才进行连接?
我安装了XAMPP Linux 1.8.2并尝试启动服务器(/opt/lampp/lampp start),它的响应如下
Starting XAMPP for Linux 1.8.2-2...
XAMPP: Starting Apache...fail.
XAMPP: Another web server is already running.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...fail.
XAMPP: Another FTP daemon is already running.
我不能打开localhost,xam
我有点困惑。我正在尝试使用端口22进行FTP。它说我是连接的,然后我不是连接的。下面是我的输出:
dan@voldemort:~$ ftp $hname 22
Connected to <hostname>.
SSH-2.0-OpenSSH_5.1
ftp> ls
Not connected.
到底怎么回事?是不是因为我在使用端口22?我知道它是ssh端口,但这就是我使用它的原因。
编辑:我想知道发生了什么。我对其他传输文件的方式不感兴趣,比如FTP客户端。我也在寻找一个命令行解决方案。我正在运行Ubuntu。
我刚安装了monit并检查了网页界面。不幸的是,尽管proftpd正在运行,但它被标记为未运行。我认为这是因为我使用的是S/FTP,而不是FTP。可以用S/FTP运行monit吗?
##CHECK ProFTPD
check process proftpd with pidfile /var/run/proftpd.pid
start program = "/etc/init.d/proftpd start"
stop program = "/etc/init.d/proftpd stop"
if failed port 21 protocol sftp the