Linux Vsftpd 连接超时解决方法(被动模式)
http://blog.csdn.net/qq_15766181/article/details/46554643
使用 FileZilla FTP Client 连接 Vsftpd FTP,在没有配置传输模式(主动模式、被动模式)时,出现了以下提示信息。我们可以手工设置传输模式为“主动模式”来解决这一问题。但由于客户端防火墙等原因,这种解决方法将不会始终有效。
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
状态: 正在连接 192.168.182.128:21...状态: 连接建立,等待欢迎消息...响应: 220 (vsFTPd 2.0.5)命令: USER bugxm_general响应: 331 Please specify the password.命令: PASS ******响应: 230 Login successful.命令: OPTS UTF8 ON响应: 200 Always in UTF8 mode.状态: 已连接状态: 读取目录列表...命令: PWD响应: 257 "/"命令: TYPE I响应: 200 Switching to Binary mode.命令: PASV响应: 227 Entering Passive Mode (192,168,182,128,172,85)命令: LIST错误: 连接超时错误: 读取目录列表失败 |
解决方法
在服务端配置被动模式就可以从根源上解决这问题。
1、编辑 Vsftpd 配置文件
|
1
|
vi /etc/vsftpd/vsftpd.conf |
2、在最下面添加以下信息
|
1
2
3
|
pasv_enable=YES #开启被动模式pasv_min_port=4000 #随机最小端口pasv_max_port=5000 #随机最大端口 |
3、加载内核 ip_conntrack_ftp 和 ip_nat_ftp(终端执行)
|
1
2
|
modprobe ip_conntrack_ftpmodprobe ip_nat_ftp |
4、配置 iptables 开放 4000 到 5000 端口
|
1
|
vi /etc/sysconfig/iptables 在*filter下加入下 |
|
1
2
|
-A OUTPUT -p tcp --sport 4000:5000 -j ACCEPT-A INPUT -p tcp --dport 4000:5000 -j ACCEPT |
5、加载 iptables 配置
|
1
|
iptables-restore < /etc/sysconfig/iptables |
6、重启 Vsftpd
|
1
|
service vsftpd restart |
测试连接
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
状态: 正在连接 192.168.182.128:21...状态: 连接建立,等待欢迎消息...响应: 220 (vsFTPd 2.0.5)命令: USER bugxm_general响应: 331 Please specify the password.命令: PASS ******响应: 230 Login successful.命令: OPTS UTF8 ON响应: 200 Always in UTF8 mode.状态: 已连接状态: 读取目录列表...命令: PWD响应: 257 "/"命令: TYPE I响应: 200 Switching to Binary mode.命令: PASV响应: 227 Entering Passive Mode (192,168,182,128,15,224)命令: LIST响应: 150 Here comes the directory listing.响应: 226 Directory send OK.状态: 列出目录成功 |
#%PAM-1.0 [/etc/pam.d/vsftpd, 注意是lib还是lib64, 登录失败 可 tail -f /var/log/secure 查看详情]
auth sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/virtusers
account sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/virtusers
session optional pam_keyinit.so force revoke
auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
auth required pam_shells.so
auth include password-auth
account include password-auth
session required pam_loginuid.so
session include password-auth
Linux Vsftpd 连接超时解决方法(被动模式)的更多相关文章
- Linux Vsftpd 连接超时解决方法
Linux Vsftpd 连接超时解决方法 2013-11-13 10:58:34| 分类: 默认分类|举报|字号 订阅 解决方法(http://www.lingdus.com/thread ...
- 基于ORA-12170 TNS 连接超时解决办法详解
转自原文 基于ORA-12170 TNS 连接超时解决办法详解 1.开始----程序-----Oracle------配置和移植工具-----Net Manager----本地----服务命名---o ...
- ssh 连接缓慢解决方法
ssh 连接缓慢解决方法 摘自:https://blog.csdn.net/qq_14821541/article/details/61915589 2017年03月13日 12:00:38 所以怎样 ...
- file_get_contents无法请求https连接的解决方法 php开启curl
file_get_contents无法请求https连接的解决方法 方法1: PHP.ini默认配置下,用file_get_contents读取https的链接,就会如下错误: Warning: fo ...
- 因修改/etc/ssh权限导致的ssh不能连接异常解决方法
因修改/etc/ssh权限导致的ssh不能连接异常解决方法 现象: $ssh XXX@192.168.5.21 出现以下问题 Read from socket failed: Connection r ...
- ssh能够连接而sftp不能连接的解决方法
ssh能够连接而sftp不能连接的解决方法 昨天开始用FileZilla一直不能登录远程的服务器,ssh的登录就OK,因为是服务器,也不敢乱动.查了好多资料终于解决了. 首先,查看一下系统的安全日 ...
- linux服务器时间同步失败解决方法
linux服务器时间同步失败解决方法 1.为什么会时间不同步: ①计算机的时间是根据电脑晶振以固定频率震荡而产生的,由于晶振的不同或者老化,会导致电脑时间积累误差的产 (什么是电脑晶振:http:// ...
- Linux时间变慢解决方法
情景:系统为CentOS-5.4,硬件时间正确(查看硬件时间的方法见下面),系统时间每隔24小时会慢20分钟左右Linux将时钟分为系统时钟(System Clock)和硬件(Real Time Cl ...
- Spotlight 连接SuSE11 linux报错的解决方法
1. 在客户端安装spotlight: 2.在SuSE11中建立新用户,并且安装了sysstat包: 3.使用spotlight连接服务器,连接时提示 errorcode:3114 reas ...
随机推荐
- iOS 引入framework的常见问题和原理
今天在引入第三方framework时,我按照以前的方法,把framework加入到了下图的地方: 默认是required的,之后程序就crash了,报错dyld: Library not loaded ...
- mysql事务和锁InnoDB
背景 MySQL/InnoDB的加锁分析,一直是一个比较困难的话题.我在工作过程中,经常会有同事咨询这方面的问题.同时,微博上也经常会收到MySQL锁相关的私信,让我帮助解决一些死锁的问题.本文,准备 ...
- VR技术的探索阶段
转载请声明转载地址:http://www.cnblogs.com/Rodolfo/,违者必究. 早在1929年,在长期使用教练机训练器(机翼变短,不能产生离开地面所需的足够提升力)进行飞行训练之后,E ...
- tensorflow添加自定义的auc计算operator
tensorflow可以很方便的添加用户自定义的operator(如果不添加也可以采用sklearn的auc计算函数或者自己写一个 但是会在python执行,这里希望在graph中也就是c++端执行这 ...
- windows批处理语法
写批处理文件,除了了解基本语法外,你还需要熟悉常用的windows命令,那就先看看这篇文章:windows常用命令 #重要说明 文件及目录路径:要使用反斜杠'\',不要使用正斜杠'/' 如:del d ...
- eclipse运行速度优化(解决狂读盘、发布慢、CPU100%等问题)
转自:http://blog.csdn.net/wyp_810618/article/details/8953921 我的ECLIPSE运行时速度奇慢,具体表现为: 1.只要ECLIPSE启动后,硬盘 ...
- 关于POI解析Excel文件(03和07版本不同)的问题
问题描述:在使用poi包进行excel解析时,发现对Excel2003以前(包括2003)的版本没有问题,但读取Excel2007时发生如下异常:org.apache.poi.poifs.filesy ...
- Codeforces Round #367 (Div. 2)
A题 Beru-taxi 随便搞搞.. #include <cstdio> #include <cmath> using namespace std; int a,b,n; s ...
- jq switch case
switch (cnt) { case ("string1"): ... ...
- string类里find的用法
#include<bits/stdc++.h> using namespace std; typedef long long ll; //int INF=(1<<31)-1; ...