为VSFTPD配置虚拟用户(文本方式)

创建虚拟与用户数据库

1. 创建loguser.txt,格式如下:

userid
pass

比如我创建两个用户:tony 密码为tonypass,etony密码为etonypass 则loguser.txt的内容如下:

tony
tonypass
etony
etonypass

2. 安装数据库生成工具:

# aptitude install libdb3-util

3. 生成数据库:

# db_load -T -t hash -f loguser.txt /etc/vsftpd_login.db

4. 设置数据库文件的访问权限:

# chmod 600 /etc/vsftpd_login.db

配置PAM文件

修改/etc/pam.d/vsftpd 内容如下:

auth required /lib/security/pam_userdb.so db=/etc/vsftpd_login
account required /lib/security/pam_userdb.so db=/etc/vsftpd_login

为虚拟用户创建本地系统用户

useradd -d /home/ftpsite virtual
mkdir /home/ftpsite
chown virtual.virtual /home/ftpsite
ls -ld /home/ftpsite
drwxr-sr-x 2 virtual virtual 48 2006-08-18 05:48 /home/ftpsite

在目录下创建一些内容

echo “etony’s vsftpd server” > /home/ftpsite/msg
chown virtual.virtual /home/ftpsite/msg

创建/etc/vsftpd.conf

根据需要创建/etc/vsftpd.conf,但要确保含有一下设置:

anonymous_enable=NO
local_enable=YES
write_enable=NO #不清楚为什么这样设置
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
chroot_local_user=YES
guest_enable=YES
guest_username=virtual
listen=YES
listen_port=21
pasv_min_port=30000
pasv_max_port=30999

5.启动vsftpd

/etc/init.d/vsftpd start|restart

6.测试

$ lftp localhost -u tony,tonypass
lftp tony@localhost:~> ls
-rw-r–r– 1 1001 1001 22 Aug 17 21:49 msg
lftp tony@localhost:/> exit
$ lftp localhost -u tony,tonyp
lftp tony@localhost:~> ls
ls: Login failed: 530 Login incorrect.

45 thoughts on “为VSFTPD配置虚拟用户(文本方式)

  1. Pingback: DVD Duplication Los Angeles

  2. Pingback: silver chloride

  3. Pingback: our website

  4. Pingback: Find Out More

  5. Pingback: 카지노사이트

  6. Pingback: 우리카지노

  7. Pingback: ww88

  8. Pingback: w88club

  9. Pingback: p228#https://sportzdrowie.com.pl/forum/rozne-f7/pokrycie-dachowe-t132.html#p228

  10. Pingback: professional cornhole boards

  11. Pingback: get more info

  12. Pingback: cheap hotel booking

  13. Pingback: ti le bong da truc tuyen

  14. Pingback: ufabet

  15. Pingback: felix wenzel is the google ads specialist

  16. Pingback: ดอกเบี้ยเงินกู้นอกระบบ

  17. Pingback: Free Bets

  18. Pingback: Ignou Project

  19. Pingback: 카지노사이트

  20. Pingback: dominoqq

  21. Pingback: online casino singapore for android

  22. Pingback: online casino malaysia

  23. Pingback: scr888 download

  24. Pingback: 토토사이트

  25. Pingback: hublot fake watches

  26. Pingback: qq online

  27. Pingback: Mega888 hack

  28. Pingback: 조커바카라

  29. Pingback: online promotion

  30. Pingback: sbobet

  31. Pingback: Dictator Dirk

  32. Pingback: 12betviet com vn

  33. Pingback: Furnace Repairs Shortys Plumbing and Heating

  34. Pingback: Sexy slim blonde cam babe hd

  35. Pingback: 4junk.info

  36. Pingback: Dylan Sellers

  37. Pingback: 24 hour plumber Haywood

  38. Pingback: 먹튀퍽

  39. Pingback: beagle puppies for sale near me in usa canada uk australia europe cheap

  40. Pingback: huong dan dang ky 12bet

  41. Pingback: nu golf thu xinh dep

  42. Pingback: Cam Girls & Porn Stars

  43. Pingback: sex

  44. Pingback: bitcoin loophole

  45. Pingback: nằm mơ thấy con rết là điềm gì

Leave a Reply