:. A5 }, h/ ~( R5 P% x$ \3 w6 r
http://www.111cn.net/sys/CentOS/88456.htm
# z, `: e& a- l8 F3 p3 ihttps://www.centos.bz/2011/03/centos-pureftpd-install/
, V {- z! E1 R- U3 D3 L0 T% M& g' A
! ^1 I" x- W* L( V餈Yum摰鋆Pure-ftpd霂衣甇仿炊憒銝嚗
7 X$ x2 M8 _ ^. e6 H; w
$ N5 |# \! K* {5 ^甇仿炊銝:蝵座um皞隞乩舫撠 CentOS 6.X3 Y* \5 O, d1 N* D( {2 B# L
憭隞(憒蝵桀嗡epel皞)
8 J$ f: j) W( @; Hmv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup# Z0 J* \( J1 S* }
銝頧賣郢epo /etc/yum.repos.d/! V6 Z, k1 q& t( l
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo0 |' Q+ l5 c7 \3 k0 s; h1 v
yum makecache7 U& c1 o( A) n* J# v* q7 P
& {1 y8 Y" j! O
隞乩舫撠 CentOS 5.X
9 O7 z/ n5 h& V# |- |: s, e Bcd /etc/yum.repos.d/
9 m& C C9 B8 Q% ~wget http://centos.karan.org/kbsingh-CentOS-Extras.repo
" I0 a2 T, z- z# U- z! X
- f! L) @& Y. ~/ e. z敹瞈瘣蝕bs-CentOS-Testing摨怒kbsingh-CentOS-Extras.repo隞塚enabled=0寞enabled=1
7 I ^# b% Y# n1 @vi kbsingh-CentOS-Extras.repo9 e1 X0 d0 x/ N! D$ h
- [kbs-CentOS-Testing]
- name=CentOS.Karan.Org-EL$releasever - Testing
- gpgcheck=1
- gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
- enabled=1
- baseurl=http://centos.karan.org/el$releasever/extras/testing/$basearch/RPMS/
銴鋆賭誨蝣 亦撠乎PG key啗隞嗅澈- rpm --import http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
銴鋆賭誨蝣 憒甇仿銝憭望閰,雿輻其誑銝隞:5 v- N) ]% p$ [# Q
rpm -Uvh ftp://ftp.trychlos.org/pub/CentOS/6.3/pcalfs/x86_64/RPMS/epel-release-6-7.noarch.rpm (CentOS 6.7)
) c, x$ Y; {" j銝臭誑CentOS 6.7,憒浚entOS 6.8 狂oogle 撠 epel-release-6-8.noarch.rpm頛暺,隞交迨憿8 D7 o1 u/ q: k3 V
$ V; d: P* U2 x. ^7 W甇仿炊鈭:yum摰鋆
6 i @1 h( H# {) j" [) V* Xyum install pure-ftpd -y j: N8 ?$ J+ Q+ \2 K) o- q
2 i6 o6 C3 m% x r+ I- [, J甇仿炊銝:靽格寥蝵格隞 _6 @, r2 N6 B8 |) N9 Q
vim /etc/pure-ftpd/pure-ftpd.conf
" b% }0 o: Y N3 D' l) A( |0 r/ ?% M% I: {' k! e+ j
PureDB /etc/pure-ftpd/pureftpd.pdb6 E% @- f2 J' ?0 o$ f
#餅餈銵瘜券嚗摰頝臬嚗PureDB冽唳桀隞* i. B+ q3 z% K- y8 D6 `( X
VerboseLog yes
* Y+ m, Q) x- j6 M& B5 }#撘舀亙 /var/log/pureftpd.log4 G. t. m3 s& Y, o! ]" P3 C3 P1 i3 `1 b0 j
NoAnonymous yes
9 I$ }& W ~) s0 g#蝏踹冽瑞餃* { r8 ~4 \$ |, F8 G
PassivePortRange 48000 50000
: [- ]+ [* \: Y6 c9 d7 u: l#雿輻刻◤冽芋撘嚗嗥垢4 m- b; g* q8 C$ }' P6 x
# }+ O. c; D/ I6 D& K9 }# P
# I; v& @. I' w6 r* K7 {5 i/ E& m$ \7 r( @) c m; {; ^& `
甇仿炊:蝵桅脩怠蝑
6 Y5 k) T3 L: [2 T8 @iptables -A INPUT -p tcp --dport 21 -j ACCEPT' M9 @$ U; z- ^
iptables -A INPUT -p tcp --dport 48000:50000 -j ACCEPT C# g. Y q0 {0 G( f; G1 L# q
5 j5 R% i( a8 a. k. O* w甇仿炊鈭:臬私ure-ftpd
" B2 B, G1 X; e. h8 P. p: h! tchkconfig pure-ftpd --level 345 on (閮剖瘥甈⊿璈芸瑁)1 R. T! F! e5 w! O4 ^- G- G6 u2 r
憒曆軏hkconfig,which chkconfig 臭誑曉啣桅雿蝵,銝祆閰脣/sbin,憒/sbin銋瘝銵函內瘝摰鋆chkconfig9 q; {# R& \4 }
yum install chkconfig 摰鋆chkconfig1 V" ]# s! [1 z+ A; F8 g- h, D
憒摰鋆摰銋 chkconfig: command not found
- {5 t; I& K4 k! m銝蝯 4 N5 } m8 L* e) _
ln -s /sbin/chkconfig /usr/bin/
$ r2 d/ T& N3 A" y( F
8 k7 x8 P4 E$ l! e. @. L3 ~, O/etc/init.d/pure-ftpd start service pure-ftpd start雿輻冽蝣澆鋆隢 http://www.111cn.net/sys/CentOS/88456.htm憒 service pure-ftpd start 銋憿舐內 service: command not found
, N6 p1 k: g) H& ?: D2 R銋雿銝蝯8 ^; W2 D n: C* I, h$ Y$ ^3 L& m, p
ln -s /sbin/service /usr/bin/
' e0 v7 S2 |, o* ~: i! I& z4 Z. m9 |3 S6 Z5 A0 W3 s* r. @
摰鋆 ftp client :. h2 |, j4 D8 k, S
yum install ftp -y& D9 E& d! y0 j- W+ q* u8 `
, K: L |2 a# ?) w! [4 l5 w閮:. ^: [* E3 P$ Z( c1 p7 ^" n( ~
# ?, }; `' u, M: |4 _ x
1.
3 B( F$ a7 a6 x+ h8 e- Kwhen login ftp show error:/ q: ]0 L+ \8 `% v
530 Login authentication failed
, X: b3 V, H7 o7 l. VLogin failed.
7 B0 t5 f( a; `! M8 ^7 \
' ~! W/ Z9 g! S: D- @5 ]0 ?$ R, |) L( a0 X" T
check /var/log/secure
* z, I' q+ G+ _Nov 3 10:03:44 DLTB-2475 pure-ftpd: pam_listfile(pure-ftpd:auth): Couldn't open /etc/ftpusers" i3 o7 w2 b$ ~6 Z7 u0 _
Nov 3 10:03:44 DLTB-2475 pure-ftpd: PAM audit_log_acct_message() failed: Operation not permitted& C4 h. n! b% J( P
$ k3 ^- H R K+ c! t% K
Sol:
# O# d2 n& E% ^ ^+ M3 R9 Zvi /etc/pure-ftpd/pure-ftpd.conf1 u2 x6 d, M& j6 t2 z
撠PAMAuthentication 隤霅寞 UnixAuthentication隤霅 ,
- `* L* O/ n/ x0 y. }6 Y: {#PAMAuthentication yes 閮餉圾
0 `: @9 q6 q% E. O) BUnixAuthentication yes 瘨閮餉圾6 e3 n' z P% G% m8 p
service pure-ftpd restart
2 ]# G# s7 }) ^& t, t" h: t I7 v# N2 I! ~* G
2.
3 y! p, D) v* d3 B, o# fWhen login ftp server from remote host show errors:
! w0 V9 D+ y7 [, r# Tconnect: No route to host
: {. B6 t! x n# ~& j舫脩怎雿鈭,iptable瘝⊥閮胤AT,SOL:
5 |. X W* M: L3 E( N8 vstop iptables or 拍嗉身摰 iptables
7 E; H) e) m+ j+ `/ d* w+ u4 p; k+ @% @% w* v4 P. R% z7 ]1 h! x
vi /etc/sysconfig/iptables-config0 h3 X( `6 `$ ^0 E' n' i5 P+ S
湔 IPTABLES_MODULES= IPTABLES_MODULES=ip_nat_ftp ip_conntrack_ftp
$ t% \! z' }3 j* x" }( zservice iptables reload
6 F5 [+ x! y: ~ O- ^4 w$ U! m& [8 R7 H4 y! L- ~2 G( |* y: v
3.2 O$ E. s: J. B$ \. I5 D. _
421 Unable to read the indexed puredb file (or old format detected) - Try pure-pw mkdb
7 g0 X5 H$ j) Q0 c7 P; cLogin failed.
. s8 T; R. [" r6 t2 f* ~' R: M) d. _* P1 Y0 ?9 D6 [
SOL:
! ~2 d0 ^" `+ P' Nvi /etc/pure-ftpd/pure-ftpd.conf8 v1 C, z( e2 }( r$ _) a' g
撠 PureDB /etc/pure-ftpd/pureftpd.pdb 閮餉圾
( n/ p# W0 G# x# W' K4.6 N+ V: q6 @9 L- v4 n0 a+ w" N
ftp> put file
- X: ^( ^, d5 v. q1 k- i) Zlocal: file remote: file
) W& l. v$ F) N0 |- p4 [2 h227 Entering Passive Mode (122,117,11,31,193,78)
9 q% b/ | a9 V/ ?' z; D8 d553 Can't open that file: Permission denied
, O1 F; R; Y( f! ]) _& i. S0 U! x9 Z ^ p7 F
SOL:7 R" I4 V4 R8 ^; i
ls -l /home/user11 j2 q d0 o* v! I; [+ n" G
drwxr-xr-x. 2 root root 4096 2016-01-17 04:46 user1
* w+ ~8 ?3 j$ g! }2 y7 Pchown user1:user1 /home/user12 ?% m2 L8 h& N* l0 ?
4 ]; h3 l6 W3 o5 i4 r: ^/ F[ftp 隞也! X+ f' w+ o% c
lcd 寡local桅8 e a% t0 a9 k# ]
lls 亦local桅瑼獢 (蝑 !ls)
! m/ B0 b" H: o$ F0 L. F# ~+ v: G1 S6 s: f7 U, s+ z
5 A; P% x# k: ^' w, f1 u
/ a \, ^8 O- Q/ c: g) h
3 _& Y& O, v5 v# d |
|