Linux 配置ftp服务

【什么是FTP】
也许你对FTP不陌生,但是你是否了解FTP到底是个什么玩意?FTP 是FileTransferProtocol
(文件传输协议)的英文简称,而中文简称为“文传协议”。用于Internet上的控制文件的
双向传输。同时,它也是一个应用程序(Application)。用户可以通过它把自己的PC机与世
界各地所有运行FTP协议的服务器相连,访问服务器上的大量程序和信息。FTP的主要作用,
就是让用户连接上一个远程计算机(这些计算机上运行着FTP服务器程序)察看远程计算机
有哪些文件,然后把文件从远程计算机上拷到本地计算机,或把本地计算机的文件送到远程
计算机去。FTP用的比NFS更多,所以你一定要熟练配置它。

【配置ftp】
安装Redhat/CentOS系统时也许你会连带着把ftp装上,系统默认带的ftp是vsftp,比较常
用,配置也很简单。但笔者常使用的ftp软件为pure-ftpd。因为这个软件比vsftp配置起来
更加灵活和安全。下面是笔者配置pure-ftpd的过程:
在这里http://syslab.comsenz.com/downloads/linux/下载最新的pure-ftp源码包pure-ftpd-1.0.21.tar.bz2

#wget  http://syslab.comsenz.com/downloads/linux/pure-ftpd-1.0.21.tar.bz2

#tar jxvfpure-ftpd-1.0.21.tar.bz2

#cdpure-ftpd-1.0.21

./configure \
"--prefix=/usr/local/pureftpd" \
"--without-inetd" \
"--with-altlog" \
"--with-puredb" \
"--with-throttling" \
"--with-largefile" \
"--with-peruserlimits" \
"--with-tls" \
"--with-language=simplified-chinese"

 

configure: error: OpenSSL headers not found.

SSL,Security Socket Layer,是一个安全传输协议,在Internet网上进行数据保护和身份确认。OpenSSL是一个开放源代码的实现了SSL及相关加密技术的软件包,由加拿大的Eric Yang等发起编写的。OpenSSL的官方网站为http://www.openssl.org/,源代码可以从ftp://ftp.openssl.org/source/上下载,也可以从OpenSSL的镜像网站下载。

安装OpenSSL

#wget  http://syslab.comsenz.com/downloads/linux/openssl-1.0.0a.tar.gz

# tar zxvf openssl-1.0.0a.tar.gz

./config
make
make install

#make&&makeinstall

 

但是还有这个错误:

configure: error: OpenSSL headers not found.

yum -y install openssl-devel

echo $?

返回0表示成功了 哈哈

make && make install

 

起动
法一:用参数
/usr/local/pureftpd/sbin/pure-ftpd-S21-c20-C1-E-u100-R-t:800-a0 &
-S 端口
-c 最大用户数
-C 线程数
-E Anonymous logins are prohibited
-u Don't allow uids below <uid> to login
-R Disallow users (even non-anonymous ones)usage of the CHMOD command
-t:800 下载800k,上传无限制
-a 0 除gid 0的组,限制用户再主目录。

 

法二:用配置文件
#mkdir /usr/local/pureftpd/etc
#cd configuration-file
#cp pure-ftpd.conf/usr/local/pureftpd/etc/pure-ftpd.conf
#cp pure-config.pl /usr/local/pureftpd/sbin/pure-config.pl
#chmod 755/usr/local/pureftpd/sbin/pure-config.pl
启动命令:/usr/local/pureftpd/sbin/pure-config.pl/usr/local/pureftpd/etc/pure-ftpd.conf
当然要修改配置文件,英文说明也不是很难。
下面是我的配置文件:

ChrootEveryone yes
BrokenClientsCompatibility no
MaxClientsNumber 50
Daemonize yes
MaxClientsPerIP 8
VerboseLog no
DisplayDotFiles yes
AnonymousOnly no
NoAnonymous no
SyslogFacility ftp
DontResolve yes
MaxIdleTime 15
PureDB /usr/local/pureftpd/etc/pureftpd.pdb
LimitRecursion 20008
AnonymousCanCreateDirs no
MaxLoad 4
AntiWarez yes
Umask 133:022
MinUID 100
AllowUserFXP no
AllowAnonymousFXP no
ProhibitDotFilesWrite no
ProhibitDotFilesRead no
AutoRename no
AnonymousCantUpload no
PIDFile /usr/local/pureftpd/var/run/pure-ftpd.pid
MaxDiskUsage 99
CustomerProof yes

#######接下来该建立用户了###############

#/usr/local/pureftpd/bin/pure-pw useradd ftp_test –u www –d /data/wwwroot其中,

-u 将虚拟用户 ftp_test 与系统用户www关联在一起。-d 参数使ftp_test 只能访问其主目录。执行
完上述命令后,会提示输入密码。
#/usr/local/pureftpd/bin/pure-pwmkdb

 

安装vim

yum -y install vim-enhanced


主要的 Linux distributions 发行者网址:

Red Hat: http://www.redhat.com 
•   Fedora: http://fedora.redhat.com 
•   Mandriva: http://www.mandriva.com 
•   Novell SuSE: http://www.novell.com/linux/suse/ 
•   Debian: http://www.debian.org/ 
•   Slackware: http://www.slackware.com/ 
•   Linpus: http://www.linpus.com.tw/ 
•   Gentoo: http://www.gentoo.org/ 
•   Ubuntu: http://www.ubuntulinux.org/ 
•   CentOS: http://www.centos.org/

转载于:https://my.oschina.net/jiaozg/blog/95146

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值