:3 k6 I5 D( r5 S& b7 p( h, P- ?
http://www.111cn.net/sys/CentOS/88456.htm
$ F/ R, V, `- m1 J: L1 ^0 a9 K9 f) h) Ghttps://www.centos.bz/2011/03/centos-pureftpd-install/
( v& v1 j3 `: t7 X& t3 L/ N" k+ f( q& x8 U0 P
餈Yum摰鋆Pure-ftpd霂衣甇仿炊憒銝嚗: G6 s# M( @6 T
9 u1 U7 @8 N5 M/ a! k: l甇仿炊銝:蝵座um皞隞乩舫撠 CentOS 6.X1 H6 H: S' g' T" d9 p' c
憭隞(憒蝵桀嗡epel皞)
$ g1 \" b8 G6 N) t0 C' y' {mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
# Q7 p4 K3 y" d; q* B% V銝頧賣郢epo /etc/yum.repos.d/" H3 N; g% ^; |3 `& U1 h/ ?
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo+ ]7 @6 I$ L# Y' P: x, @
yum makecache
& Z3 B6 u0 O$ z! v
`( q- y% v0 P M; S+ N+ v隞乩舫撠 CentOS 5.X7 c# Y0 k' u& t# R& n: B. q
cd /etc/yum.repos.d/1 j6 ~# m& t" ~: }3 e4 o
wget http://centos.karan.org/kbsingh-CentOS-Extras.repo
: n& b9 V+ R' i$ q. l0 z& j. g; q, {5 p/ h* J0 |
敹瞈瘣蝕bs-CentOS-Testing摨怒kbsingh-CentOS-Extras.repo隞塚enabled=0寞enabled=10 e/ o3 C! U5 q$ }4 X* |8 {9 V! G) c
vi kbsingh-CentOS-Extras.repo! \6 }: q7 W5 W. }+ z" x
- [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
銴鋆賭誨蝣 憒甇仿銝憭望閰,雿輻其誑銝隞:
* `1 P6 U, ?, v+ Y }7 X% ?rpm -Uvh ftp://ftp.trychlos.org/pub/CentOS/6.3/pcalfs/x86_64/RPMS/epel-release-6-7.noarch.rpm (CentOS 6.7)/ B" ~2 M& B1 _, i" R
銝臭誑CentOS 6.7,憒浚entOS 6.8 狂oogle 撠 epel-release-6-8.noarch.rpm頛暺,隞交迨憿" L% R: x. k4 @- G* `& I
) F: j: F {0 D7 U甇仿炊鈭:yum摰鋆
C: z' S6 ?% E( ryum install pure-ftpd -y
7 t6 o% x- ]' n) L O; W' J% d$ O& P
/ h3 }. Q* t: R' d% S甇仿炊銝:靽格寥蝵格隞: C( _; o! M6 F3 A2 Y* p
vim /etc/pure-ftpd/pure-ftpd.conf, V5 h% v% y; |; J1 r
, Y+ [! G l" C: P1 v- y
PureDB /etc/pure-ftpd/pureftpd.pdb
/ W' V+ u4 @8 }8 c3 k; P#餅餈銵瘜券嚗摰頝臬嚗PureDB冽唳桀隞7 ^* Y$ ?2 x0 J& }8 X g Q
VerboseLog yes$ J7 k4 _- w! I
#撘舀亙 /var/log/pureftpd.log/ ^* z" ^% S/ P1 w; g. W5 N) r
NoAnonymous yes6 Y1 {" w' d- g) P1 e
#蝏踹冽瑞餃
; j: a9 ^5 u& ^% V( B- \/ H. vPassivePortRange 48000 50000
3 N; T `4 Q2 k4 K& K- T#雿輻刻◤冽芋撘嚗嗥垢& j) l6 H$ a0 ?7 q4 d* r
2 K+ a5 V b* m# J9 H9 m- c! ?( {. L9 J& }: w5 t1 p
9 ^1 N/ _- n( s4 ~9 d) P
甇仿炊:蝵桅脩怠蝑
) ^8 @3 ]7 H4 D+ Giptables -A INPUT -p tcp --dport 21 -j ACCEPT$ Z' `. c. I' ^; f. s* U$ R1 V; S
iptables -A INPUT -p tcp --dport 48000:50000 -j ACCEPT$ o0 ?% Q' F" S3 K0 C7 l: v9 [
; g( B) e. f. S
甇仿炊鈭:臬私ure-ftpd) c- c# h" Z5 d! T3 T
chkconfig pure-ftpd --level 345 on (閮剖瘥甈⊿璈芸瑁)
+ |3 f8 c9 r/ S- n# x! e( P/ ~憒曆軏hkconfig,which chkconfig 臭誑曉啣桅雿蝵,銝祆閰脣/sbin,憒/sbin銋瘝銵函內瘝摰鋆chkconfig
- {+ E9 I3 @* W1 Oyum install chkconfig 摰鋆chkconfig
B3 B0 m$ m4 {' m0 I6 Z* m( A, P憒摰鋆摰銋 chkconfig: command not found3 U$ W E8 X0 _) k
銝蝯
) p7 w* U/ P% | e3 A: hln -s /sbin/chkconfig /usr/bin/" b7 I3 Z1 ^; v# F9 @& s
$ R4 r6 M" t% ^& o- C/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: E2 T& V/ t. a+ T1 C
銋雿銝蝯5 J0 F: t) F. x j |: s7 g' }" l
ln -s /sbin/service /usr/bin/
, i5 T! q9 g3 u+ \- ]5 B' S, w. x3 {- y' j; n6 `( |' Y
摰鋆 ftp client :! G% C9 f5 M. A/ g
yum install ftp -y
2 F+ |6 F6 p' k3 e: w' k; a% u
閮:
$ V# r5 U4 E) W$ \) u0 y
6 L! D0 R6 q$ e; S3 f+ C) m5 s1.: y6 o! i/ N# T
when login ftp show error: f9 x! q8 a7 ]& O+ B
530 Login authentication failed
6 Z+ w1 a4 v3 [Login failed.; g& l" D z) z. g/ B( y, E0 E
0 v- X; E8 _* D6 m3 H
) W. e- ]% A4 B# a7 J' J1 ~) icheck /var/log/secure
8 D6 m7 `0 E, |' X* _$ GNov 3 10:03:44 DLTB-2475 pure-ftpd: pam_listfile(pure-ftpd:auth): Couldn't open /etc/ftpusers2 I3 ~/ M1 s3 T' H" N
Nov 3 10:03:44 DLTB-2475 pure-ftpd: PAM audit_log_acct_message() failed: Operation not permitted, O$ _ l" `, m) f# c9 v0 j5 R4 t1 ~
' M6 c; d: K. Z- N- lSol:5 C* U q \$ X: Q" z& T
vi /etc/pure-ftpd/pure-ftpd.conf% K: |/ m+ b' D4 Y& y& F) g% I2 |
撠PAMAuthentication 隤霅寞 UnixAuthentication隤霅 ,
% ~2 y( ~6 ^! X) L#PAMAuthentication yes 閮餉圾* a1 x2 d8 [8 R. f0 h3 k8 [
UnixAuthentication yes 瘨閮餉圾6 j' j' x- R5 V' y0 z
service pure-ftpd restart
* W8 V7 q- O6 i8 n, k. W3 m+ o% \$ B; Z8 l% Z! x9 g1 H
2.
+ r r- S2 \1 q5 R: f' l! ZWhen login ftp server from remote host show errors:
7 ^% P- z- C9 p( }7 x: s A" Cconnect: No route to host1 E. Q+ q# E/ H" a6 j* a+ b
舫脩怎雿鈭,iptable瘝⊥閮胤AT,SOL:: Q6 I0 L5 h. e1 s2 I7 _2 l
stop iptables or 拍嗉身摰 iptables
* F: M) s' ]- M, I9 u; Z+ [8 l6 a* Z8 z& @
vi /etc/sysconfig/iptables-config
9 y% t, Q5 u% }" H8 \+ \2 u湔 IPTABLES_MODULES= IPTABLES_MODULES=ip_nat_ftp ip_conntrack_ftp
5 Y% Y- u0 V1 o8 `' s* sservice iptables reload
3 v6 H/ ^; G/ A$ s& i' r. B8 U- K1 n* n: N) K4 e0 h& W
3.
' u& c. {. Q0 x9 w0 j( A421 Unable to read the indexed puredb file (or old format detected) - Try pure-pw mkdb% {5 z# A7 R; C: M A: `
Login failed.
6 w& j. J+ G1 A. `7 v
3 R$ z) l+ b2 @7 ^SOL:
% V) u* h- D3 |! y( ?vi /etc/pure-ftpd/pure-ftpd.conf q# ]* _! y' f
撠 PureDB /etc/pure-ftpd/pureftpd.pdb 閮餉圾7 B. l1 u3 d1 O) c2 Q' w2 l
4.! k5 M2 f/ A g6 E
ftp> put file; U4 A t, v; Y) I
local: file remote: file2 p3 q4 Q1 k! r3 l# [% C; R
227 Entering Passive Mode (122,117,11,31,193,78)5 s7 ]- a! Z7 B; p' A+ ]/ U
553 Can't open that file: Permission denied
6 }- X1 V& T! h$ w! h9 ]7 j7 w T. r" w
SOL:
- @" j$ C/ a3 _' | S* e T' Q, |ls -l /home/user1
- `) z( M k# O+ J' Edrwxr-xr-x. 2 root root 4096 2016-01-17 04:46 user1
: t9 f# s5 ]! f U ~chown user1:user1 /home/user1
9 W2 } B. O: l$ r, t( Z+ x- ]! S- j' `4 y5 @% k* C' F0 {
[ftp 隞也 ?. E" \9 m4 K$ g) o7 D! Z
lcd 寡local桅
9 ^ _+ f6 a7 X8 p- Blls 亦local桅瑼獢 (蝑 !ls)
/ S8 K- H. X/ `* E. `: {( \2 k! A) j- w9 S
' p1 _# Y0 \5 E8 {) R( e. Y2 t4 t+ K/ l& z g, w- h
/ {# J- r* W' o1 N |
|