0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
阅读:2114回复:17

Debian下vsftp虚拟用户?急!

楼主#
更多 发布于:2005-08-21 10:47
vsftp+pam+mysql实现虚拟用户
配置应该都没问题啊~~可是就是不行~~感觉/etc/vsftp.conf不管用...[em102]..

配置如下
1 guest用户
 在系统内加了 ftpguest 用户,主目录 /var/ftp

2 /etc/vsftp.conf
#前面有些默认的配置就不列出来了~~
guest_enable=YES
guest_username=ftpguest
virtual_use_local_privs=YES
write_enable=YES
anon_upload_enable=YES
anon_other_write_enable=YES
chroot_local_user=YES
anonymous_enable=NO
local_enable=YES


3 mysql设置
创建 ftp_user 数据库,upload_user表,字段 id uu_user uu_passwd create_time
给予 ftpguest 用户对 ftp_user.upload_user 表的select权限

4 /etc/pam.d/vsftpd
# Standard behaviour for ftpd(8).
#auth   required        pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed

# Note: vsftpd handles anonymous logins on its own.  Do not enable
# pam_ftp.so.

# Standard blurb.
@include common-account
@include common-session

@include common-auth
auth    required        pam_shells.so

# ----MODIFIED----
auth    required        /lib/security/pam_mysql.so      user=ftpguest   passwd=123456   host=localhost  db=ftp_user     table=upload_user       usercolumn=UU_NAME      passwdcolumn=UU_PASSWD  crypt=0
account required        /lib/security/pam_mysql.so      user=ftpguest   passwd=123456   host=localshot  db=ftp_user     usercolumn=uu_name      passwdcolumn=uu_passwd  crypt=0


在登录时可以看到 mysql 的日志里有以下日志
Time                 Id Command    Argument
050821  9:54:49       1 Connect     ftpguest@localhost on ftp_user
                      1 Init DB     ftp_user
                      1 Query       SELECT UU_PASSWD FROM upload_user WHERE UU_NAME='test1'
050821  9:54:52       1 Quit

但是就是登录不成功。。。

而且感觉 /etc/vsftpd.conf 不管用,anonymous_enable=NO可是匿名用户还是能登录。。
帮忙看看有什么问题~急!!
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
zhaoshi
写手
写手
  • 铜币44枚
  • 威望10点
  • 贡献值1点
  • 社区居民
1C#
发布于:2007-01-05 22:14
Re:Debian下vsftp虚拟用户?急!
我好长时间都以为RPWY是"RePort WhaT "的缩写,终于有一天明白是"人品问题"的缩写.
Foolish,stupid,are you out of your mind? 站得更高,尿得更远~
suchasplus
作家
作家
  • 铜币16枚
  • 威望11点
  • 贡献值1点
2C#
发布于:2006-11-05 18:47
Re:Debian下vsftp虚拟用户?急!
RPWT
0000的RP明显上升了
The history of these days will be written in blood... By crushing the armies of our enemy, by seizing the weapons they thought to turn against us, we were fighting for our very existence!
0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
3C#
发布于:2006-11-05 17:08
Re:Debian下vsftp虚拟用户?急!
顶一下老帖,今天虚拟用户不知道怎么又出毛病了~~然后又修好了~
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
4C#
发布于:2005-08-23 13:07
Re:Debian下vsftp虚拟用户?急!
還是Debian的 apt-get 方便~~~~
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
5C#
发布于:2005-08-23 13:06
Re:Debian下vsftp虚拟用户?急!
誰說沒好`~好像在 /lib/security/pam_mysql.so

我那vi好像是不太好用~~不過反正我不用~~[ibook沒有insert鍵的說。。。]
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
suchasplus
作家
作家
  • 铜币16枚
  • 威望11点
  • 贡献值1点
6C#
发布于:2005-08-23 12:51
Re:Debian下vsftp虚拟用户?急!
你的机子里面明明没有pam_mysql.so
汗~  debian确实不一样啊
现在rhel4可以官方升级  肯定比debian顺手 呵呵
VI都........
The history of these days will be written in blood... By crushing the armies of our enemy, by seizing the weapons they thought to turn against us, we were fighting for our very existence!
0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
7C#
发布于:2005-08-23 08:14
Re:Debian下vsftp虚拟用户?急!
The god knows..
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
suchasplus
作家
作家
  • 铜币16枚
  • 威望11点
  • 贡献值1点
8C#
发布于:2005-08-23 02:42
Re:Debian下vsftp虚拟用户?急!
why?
The history of these days will be written in blood... By crushing the armies of our enemy, by seizing the weapons they thought to turn against us, we were fighting for our very existence!
0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
9C#
发布于:2005-08-22 15:22
Re:Debian下vsftp虚拟用户?急!
连那些 include ...全都不能留!~~
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
10C#
发布于:2005-08-22 15:21
Re:Debian下vsftp虚拟用户?急!
操!解决了~~
要把 /etc/pam.d/vsftpd 中的其它内容全都注释掉!!!
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
11C#
发布于:2005-08-22 09:19
Re:Debian下vsftp虚拟用户?急!
用 /usr/share/doc/vsftpd/EXAMPLE/VIRTUAL_USERS/vsftpd.conf 覆盖了/etc/vsftpd.conf
把端口改回 21 ,加上 pam_service_name=vsftpd
匿名用户已经不能登录了(/etc/vsftpd.conf终于起了作用,但是本地用户还是不能登录,虚拟用户登录时可以看到mysql.log里记录有查找用户,但是登录不成功,原因应该是本地用户没法登录造成的,因为虚拟用户还是“映射”到本地的ftpguest用户嘛`~~)
debian-vm:~# cat /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=ftpguest
listen=YES
listen_port=21
pasv_min_port=30000
pasv_max_port=30999
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/vsftpd.pem
secure_chroot_dir=/var/run/vsftpd
connect_from_port_20=YES
xferlog_enable=YES
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
12C#
发布于:2005-08-22 08:53
Re:Debian下vsftp虚拟用户?急!
今天居然上課....-_-#...
昨晚在小白上試了下~~感覺有希望了~~雖然沒成功。。。-_|||
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
suchasplus
作家
作家
  • 铜币16枚
  • 威望11点
  • 贡献值1点
13C#
发布于:2005-08-22 02:52
Re:Debian下vsftp虚拟用户?急!
我想,验证/etc/vsftpd.conf管不管用,你可以故意把某个参数写错,重启服务看能不能用。比如说guest_enable=YES 改成gues_enable=YES

/etc/pam.d/vsftpd 中只留这两行,其他的都注释调试试
auth    required        /lib/security/pam_mysql.so      user=ftpguest   passwd=123456   host=localhost  db=ftp_user     table=upload_user       usercolumn=UU_NAME      passwdcolumn=UU_PASSWD  crypt=0
account required        /lib/security/pam_mysql.so      user=ftpguest   passwd=123456   host=localshot  db=ftp_user     usercolumn=uu_name      passwdcolumn=uu_passwd  crypt=0


现在好郁闷  开课了~~
de bian 不会用啊~  感觉 RH顺手  呵呵
The history of these days will be written in blood... By crushing the armies of our enemy, by seizing the weapons they thought to turn against us, we were fighting for our very existence!
0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
14C#
发布于:2005-08-21 20:56
Re:Debian下vsftp虚拟用户?急!
nano。。。

大便哪来的 rpm...

我不关机~~(已经3天12小时21分了。。。)希望这次不要再挂掉电源。。。

帮俺找找原因啊~~实在找不出来了~~再不找出来耽搁测试就麻烦了。。~~3Q啊~

莫非这次又是 RPWTException ?>.....-_-#.
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
suchasplus
作家
作家
  • 铜币16枚
  • 威望11点
  • 贡献值1点
15C#
发布于:2005-08-21 20:19
Re:Debian下vsftp虚拟用户?急!
VI不会用...和RH的不一样
不会退出.....rpm q也不行.....
回头拿rh试验好了~
The history of these days will be written in blood... By crushing the armies of our enemy, by seizing the weapons they thought to turn against us, we were fighting for our very existence!
0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
16C#
发布于:2005-08-21 14:35
Re:Debian下vsftp虚拟用户?急!
都有了~~我觉得问题在这个地方:
感觉 /etc/vsftpd.conf 不管用,anonymous_enable=NO可是匿名用户还是能登录。。

有时间的话帮我看一下~~
用虚拟机做测试来着~~什么都没有~哈哈~~
10.64.65.190
root
123456
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
suchasplus
作家
作家
  • 铜币16枚
  • 威望11点
  • 贡献值1点
17C#
发布于:2005-08-21 14:06
Re:Debian下vsftp虚拟用户?急!
我用的RHEL4,不是大便,  0000参考一下吧
ls -l | grep pam_mysql  /lib/security

看看有没有pam_mysql.so
没有的话去sf下一个,tar之后在make一下,就可以把pam_mysql.so cp 到/lib/security中了~
make之前要确保mysql_devel已经安装.....

在vsftpd.conf里面加一行
pam_service_name=/etc/pam.d/vsftpd


其他的没看出虾米
0000试试吧,洗脸吃饭去~
The history of these days will be written in blood... By crushing the armies of our enemy, by seizing the weapons they thought to turn against us, we were fighting for our very existence!
游客

返回顶部