該文檔主要是記錄 proftpd 配置 SSL/TSL 的安裝部署配置文檔node
下載最新版的 proftpdpython
wget https://github.com/proftpd/proftpd/archive/master.zip
git
安裝github
unzip master cd proftpd-master ./configure --with-modules=mod_tls --prefix=/apps/svr/proftpd make && sudo make install
sudo yum -y install gnutls*
下載 openssl-1.0.2windows
wget http://www.openssl.org/source/openssl-1.0.2.tar.gz
服務器
解壓編譯安裝app
tar -zxvf openssl-1.0.2.tar.gz cd openssl-1.0.2 ./config make && sudo make install
下載 lftptornado
wget http://lftp.yar.ru/ftp/lftp-4.6.1.tar.gz
解壓編譯安裝測試
./configure --without-gnutls --with-openssl=/usr/local/ssl make && sudo make install
mkdir -p /home/test/proftpd/etc/ftpcert openssl genrsa 1024 > /home/test/proftpd/etc/ftpcert/host.key openssl req -new -x509 -nodes -sha1 -days 365 -key host.key > /home/test/proftpd/etc/ftpcert/host.cert2
### 配置 proftpdui
配置文件以下,/home/test/proftpd/etc/proftpd.conf
ServerName "ProFTPD Default Installation" ServerType standalone DefaultServer on Port 21 UseIPv6 off Umask 022 #日誌格式 LogFormat default "%h %l %u %t \"%r\" %s %b" LogFormat auth "%v [%P] %h %t \"%r\" %s" LogFormat write "%h %l %u %t \"%r\" %s %b" DefaultTransferMode binary ServerIdent off MaxInstances 50 User nobody Group nobody DefaultRoot ~ RootLogin off RequireValidShell off AllowOverwrite on #加快 ftp 的鏈接效率,去掉 DNS反向查詢 UseReverseDNS off IdentLookups off TransferLog /tmp/logs/ftpd/xferlog ExtendedLog /tmp/logs/ftpd/access.log WRITE,READ write ExtendedLog /tmp/logs/ftpd/auth.log AUTH auth ExtendedLog /tmp/logs/ftpd/paranoid.log ALL default <Limit SITE_CHMOD> DenyAll </Limit> ###匿名用戶,全局 <Anonymous ~ftp> User ftp Group ftp UserAlias anonymous ftp MaxClients 10 DisplayLogin welcome.msg DisplayChdir .message <Limit WRITE> DenyAll </Limit> </Anonymous> #### 配置 TLS 部分 <IfModule mod_tls.c> TLSEngine on TLSLog /tmp/logs/ftpd/proftpd-tls.log TLSProtocol SSLv3 TLSv1 TLSRequired on TLSRSACertificateFile /home/test/proftpd/etc/ftpcert/host.cert TLSRSACertificateKeyFile /home/test/proftpd/etc/ftpcert/host.key TLSVerifyClient off TLSRenegotiate required off </IfModule> ####對ftp的登陸用戶作限制 <Limit LOGIN> AllowUser test DenyAll </Limit> #### 對 FTP 的訪問 IP 作限制 <Limit LOGIN> Allow from 192.168.xx.xx DenyAll </Limit> <Directory /> <Limit ALL> AllowUser test DenyAll </Limit> </Directory>
後臺啓動命令
sudo /apps/svr/proftpd/sbin/proftpd -c /apps/svr/proftpd/etc/proftpd.conf
調試命令
sudo /apps/svr/proftpd/sbin/proftpd -c /apps/svr/proftpd/etc/proftpd.conf -d 10 -n
注:上面的 -n 選項是表示不後臺啓動,-d 選項是 debug 級別,從 0-10 級別,10 是最高級別
lftp -u test 192.168.xx.xx Password: (這裏輸入 test 的密碼) lftp apps@192.168.44.105:~> ls -rw-rw-r-- 1 apps apps 70305 Jun 17 2014 MySQL-python-1.2.3.tar.gz drwxr-xr-x 19 root root 4096 Jul 25 2013 Python-2.7 -rw-rw-r-- 1 apps apps 256862 Jun 17 2014 setuptools-0.6c11.tar.gz drwxr-xr-x 15 root root 4096 Jun 20 2014 software drwxr-xr-x 8 root root 4096 Jul 23 2014 tornado-2.0