彻底解决vsftp+虚拟用户的一切问题
Friday, April 28, 2006 5:45:43 PM
后来仔细想想可能是pam安装不的正确,于是重新安装pam想不到现在blfs svn里的pam已经是0.99.3.0了。
下载安装,这个倒是没费什么力气,都是按照blfs book里的步骤来的。
安装完成后我在祈祷着成功,可是还是老样子,于是抱头痛哭,哭完看系统日志显示:
vsftpd: PAM [error: /lib/security/pam_userdb.so: undefined symbol: dbm_firstkey]
于是google……,跑到了gentoo的官方论坛,他们说pam,db,vsftpd按顺序重新emerge,对lfs来说就是重新再安装了
可是安装完成后仍然是老样子,也没什么心情研究人家的ebuild file还是想找找具体原因。
最后才明白pam_userdb的ldd应该是这个样子:
ldd /lib/security/pam_userdb.so linux-gate.so.1 => (0xffffe000) libpam.so.0 => /lib/libpam.so.0 (0xb7e52000) libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7e24000) libc.so.6 => /lib/libc.so.6 (0xb7cf0000) libdl.so.2 => /lib/libdl.so.2 (0xb7cec000) /lib/ld-linux.so.2 (0x80000000)
而我的却是跟db的动态连接,应该问题就在这里,我真的是不想在重新编译pam了,想想反正就是个pam_userdb.so文件不如到rpmfind随便找个替代好了。
结果我成功了:D,虚拟用户终于可以登录了,下面就是定位各个虚拟用户的目录了,我以为这些都没什么复杂的,在说配置文件都是以前写好的,直接copy就好了。
可是后来我又要哭了,这次用户名密码都验证成功它却给我这个提示:
Login failed: 500 OOPS: cannot change directory:****
现在看到这个就觉得恶心,我是这样解决的,在虚拟用户的文件里添加这些:
user_sub_token=$USER local_root=/****/*****/……/$USER
手册中是这样说的(早知道真该好好看看手册):
user_sub_token
This option is useful is conjunction with virtual users. It is used to automatically generate a home directory for each virtual user, based on a template. For example, if the home directory of the real user specified via guest_username is /home/virtual/$USER, and user_sub_token is set to $USER, then when virtual user fred logs in, he will end up (usually chroot()'ed) in the directory /home/virtual/fred. This option also takes affect if local_root contains user_sub_token.
Track with co.mments






