Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3046017
  • 博文数量: 535
  • 博客积分: 15788
  • 博客等级: 上将
  • 技术积分: 6507
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-07 09:11
文章分类

全部博文(535)

文章存档

2016年(1)

2015年(1)

2014年(10)

2013年(26)

2012年(43)

2011年(86)

2010年(76)

2009年(136)

2008年(97)

2007年(59)

分类: LINUX

2008-12-29 13:19:59

文件:FTP之主动和被动.pdf
大小:482KB
下载:下载


被动ftp的配置

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
port_enable=NO
pasv_enable=YES

#log_ftp_protocol=YES
#syslog_enable=YES
#dirlist_enable=YES
chroot_local_user=YES
local_root=/usr/local/apache/htdocs/   #所有本地用户的根都是该目录



pasv_min_port=9981
pasv_max_port=9986

关于错误
ftp> ls
215 UNIX Type: L8
500 OOPS: vsf_sysutil_recv_peek

解决办法:modprobe capability




pam_service_name=vsftpd
userlist_enable=YES
userlist_deny=YES
userlist_file=/etc/vsftpd.usr_list
tcp_wrappers=YES
port_enable=NO
pasv_enable=YES

#log_ftp_protocol=YES
#syslog_enable=YES
#dirlist_enable=YES
chroot_local_user=YES
local_root=/usr/local/apache/htdocs/



pasv_min_port=9981
pasv_max_port=9986




cannot change directory:/home/***
ftp服务器连接失败,错误提示:
500 OOPS: cannot change directory:/home/*******
500 OOPS: child died

解决方法:
man ftpd_selinux
在终端输入命令:
setsebool ftpd_disable_trans 1 
/usr/sbin/setsebool -P ftp_home_dir 1
注意一定要重启
service vsftpd restart
就OK了!

passive模式,如果想在windows下使用命令行自动化上传或下载ftp的内容,可以使用ncftp,
下载安装后,改工具提供多个命令,如:
  •  - FTP browser program
  •  - command-line utility program
  •  - command-line utility program
  •  - command-line utility program
  •  - background FTP program for individual users
  •  - background batch FTP service for systems



关于使用xp自带的ftp工具不能连接时:
ftp> ls
200 PORT command successful. Consider using PASV.
425 Failed to establish connection.

Here is what I have tried...
1. I have tried going into PASV mode by typing 'quote PASV' with the same
results.
2. Other computers on my same network can access the server fine (XP Pro,
Server 2000, and Server 2003).
3. Installed Core FTP and it connects to the server fine
4. IE connects to the server fine
5. netstat shows an active connection to the server on port 21 ( TCP
Kiwi:2143 xxx.xxx.xxx:ftp ESTABLISHED)


This is an Active-mode / Passive mode problem. FTP.exe that ships with
Windows only supports active mode. Entering the 'quote PASV' command
puts the server in passive mode, but the client is still in active
mode. You need to find an FTP client that supports passive mode.

For further info:
"Windows FTP Client Receives Error Message 425"
<


f you've ever setup vsftpd and noticed that when you login it defaults the user to their home directory

eg: user anyweb will ftp in to

/home/anyweb/

then how can you let that user access another folder outside of their home ?

using bind !

here's a quick example

[root@www anyweb]# mkdir ftp2
[root@www anyweb]# mount --bind /ftp2  /home/anyweb/ftp2
[root@www anyweb]# mkdir ftp3
[root@www anyweb]# mount --bind /ftp3  /home/anyweb/ftp3

阅读(4115) | 评论(0) | 转发(0) |
0

上一篇:phpmyadmin

下一篇:sitemap.xml标签详解

给主人留下些什么吧!~~