</p> vsftpd服务器中的虚拟用户可以灵活的针对不同的用户账号设置不同的用户权限:7 w: ~- z) T# c- `3 r
1、设置主配置文件
. e, L% J D4 w4 z/ G9 I 在vsftpd配置文件中添加user_config_dir配置项,并设置用户配置文件的保存路径
& q* P7 Z( k. B9 x user_config_dir=/etc/vsftpd_user_conf(设置在"/etc/vsftpd_user_conf"目录中保存虚拟用户的配置文件.)0 ?3 @ b" T" f& K, V G& n
2、建立用户配置文件目录3 `/ ]* N1 e* e; F
# mkdir /etc/vsftpd_user_conf7 a6 G5 | J2 { i, W( w, O3 b* [5 A
3、为虚拟目录建立单独的配置文件* q$ G; N! l. S$ I5 q
为用户建立独立的配置文件,配置文件名称和用户名相同,并给他相应的权限.6 M J1 ]- z1 `& A
# vi /etc/vsftpd_user_conf/rr: ]& R) H: F2 b- \0 c5 `, p
anon_world_readable_only=no //表示用户可以浏览ftp目录和下载文件.
8 M, y9 X3 _3 U1 x0 v # ftp 172.16.16.1215 m% ?$ g2 ~7 r' s" X& ~/ `+ Z
Connected to 172.16.16.121.) k9 H6 x' d. g; K* C
220 (vsFTPd 2.0.1)
7 y/ {, V; A$ G2 r- u, ? 530 Please login with USER and PASS.
6 b$ h9 v2 \- W6 O 530 Please login with USER and PASS.+ s! l$ H9 x v# y+ v L
KERBEROS_V4 rejected as an authentication type
, c) @5 o3 k2 j! E* `1 O Name (172.16.16.121:root): rr' S% L6 _. C; v8 Z
331 Please specify the password.# W# W; ~* U. a+ H/ i* H& c. N
Password:& H- z* d9 s" F6 R7 Y
230 Login successful.
. a4 u1 D) K8 K' q1 O$ N/ l: f Remote system type is UNIX.) C1 H/ G) Z& e2 |+ p8 V
Using binary mode to transfer files.3 ^8 o) @% x) T V
ftp> ls& S7 ]9 x- ~+ t9 ^+ N2 z
227 Entering Passive Mode (172,16,16,121,250,156)
0 Q% \) \: X& x& u 150 Here comes the directory listing.
, G( k# _5 g* K -rw-r--r-- 1 0 0 29 May 26 05:27 44.txt
_1 ` _( U6 S4 h1 G# U$ @ -rw-r--r-- 1 0 0 0 May 26 05:30 55.txt: C: _/ U) j d7 ^
-rw-r--r-- 1 503 503 0 May 26 05:24 afile4 G" e: `( x: d. \" k% {, H
-rw-r--r-- 1 503 503 0 May 26 06:10 file01 |