首页 > 代码库 > linux资料整理之proftpd服务安装管理

linux资料整理之proftpd服务安装管理

博客:http://lijinhuan.blog.51cto.com/

微博:http://weibo.com/lijinhuanexperience

微信:xiaoleetongxue



一、安装

(1)wget -c ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.4b.tar.gz

(2)tar zxf proftpd-1.3.4b.tar.gz

    (3)cd proftpd-1.3.4b

(4)./configure --prefix=/usr/local/proftpd

    (5)make && make install



二、軟连接创建

ln -s /usr/local/proftpd/sbin/proftpd /usr/local/bin/

        

ln -s /usr/local/proftpd/bin/ftpasswd /usr/local/bin/



三、修改配置文件/usr/local/proftpd/etc/proftpd.conf


ServerName                      "ProFTPD FTP Server"

ServerType                      standalone

DefaultServer                   on


Port                            21


UseIPv6                         off


Umask                           022


MaxInstances                    30


User                            nobody

Group                           nogroup


PassivePorts                    20000 30000


DefaultRoot ~


AllowOverwrite    on


AllowRetrieveRestart   on

AllowStoreRestart      on

UseReverseDNS off

IdentLookups off


ServerIdent off

RequireValidShell off

AuthUserFile /usr/local/proftpd/etc/ftpd.passwd

AuthOrder mod_auth_file.c mod_auth_unix.c


AllowOverwrite          on


<Limit SITE_CHMOD>

 DenyAll

</Limit>

SystemLog     /usr/local/proftpd/var/log/proftpd.log

Include /usr/local/proftpd/etc/vhost/*.conf

四、修改防火墙

/sbin/iptables -I INPUT -p tcp --dport 21 -j ACCEPT

/sbin/iptables -I INPUT -p tcp --dport 20 -j ACCEPT

/sbin/iptables -I INPUT -p tcp --dport 20000:30000 -j ACCEPT

/sbin/iptables-save

五、添加ftp用户

    mkdir /usr/local/proftpd/etc/vhost

mkdir /home/lijinhuan

useradd -s /sbin/nologin -d $userdir -c " proftpd user" $username

cat >/tmp/$user.passwd<<eof

lijinhuan:lijinhuanpass

eof

chpasswd < /tmp/lijinhuan.passwd

cat >/usr/local/proftpd/etc/vhost/lijinhuan.conf<<eof

<Directory $userdir>

<Limit ALL>

 AllowUser lijinhuan

</Limit>

</Directory>

eof

/usr/local/proftpd/sbin/proftpd start

chown -R -v lijinhuan:lijinhuan /home/lijinhuan

六、详细说明:

http://linux.vbird.org/linux_server/0410proftpd.php

http://blog.fens.me/linux-ftp-proftpd/


linux资料整理之proftpd服务安装管理