LINUX.ORG.RU
решено ФорумAdmin

vsftpd. настройка виртуальных пользователей.

 , , ,


0

1

Debian wheezy. не получается настроить виртуальных пользователей, при попытке залогиниться в auth.log валится ошибка (файл /etc/vsftpd_logins существует):

Oct 24 12:27:10 gate vsftpd: pam_userdb(vsftpd:auth): user_lookup: could not open database `/etc/vsftpd_logins': No such file or directory

/etc/pam.d/vsftpd:

auth    required pam_userdb.so db=/etc/vsftpd_logins
account required pam_userdb.so db=/etc/vsftpd_logins

так же пробовал аутентификацию через htpasswd, перебрал всю возможную криптографию, при этом auth.log всегда выдаёт следующее:

Oct 24 12:14:30 gate pam_pwdfile[1]: wrong password for user admin
Oct 24 12:14:54 gate pam_pwdfile[1]: wrong password for user admin

vsftpd.conf:

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=NO
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
virtual_use_local_privs=YES
guest_enable=YES
user_sub_token=www-data
local_root=/var/ftp

/var/ftp:

drwxr-xr-x 2 www-data www-data 4096 Окт 24 09:43 /var/ftp/

★★

Последнее исправление: Acceptor (всего исправлений: 1)

файл /etc/vsftpd_logins существует

Читай документацию, это должен быть /etc/vsftpd_logins.db

sdio ★★★★★
()
Ответ на: комментарий от Acceptor
Step 1) Create the virtual users database.
We are going to use pam_userdb to authenticate the virtual users. This needs
a username / password file in "db" format - a common database format.
To create a "db" format file, first create a plain text files with the
usernames and password on alternating lines.
See example file "logins.txt" - this specifies "tom" with password "foo" and
"fred" with password "bar".
Whilst logged in as root, create the actual database file like this:

db_load -T -t hash -f logins.txt /etc/vsftpd_login.db
(Requires the Berkeley db program installed).
NOTE: Many systems have multiple versions of "db" installed, so you may
need to use e.g. db3_load for correct operation. This is known to affect
some Debian systems. The core issue is that pam_userdb expects its login
database to be a specific db version (often db3, whereas db4 may be installed
on your system). You might check ahead what specific db version you'll need
by looking at the dependcies of the pam module. Some methods to do that is to
run ldd on the pam_userdb.so or look at the dependencies of the package with ...
sdio ★★★★★
()
Ответ на: комментарий от sdio
db5.1_load -T -t hash -f logins /etc/vsftpd_login.db

ls -la /etc/vsftpd_login.db:

-rw------- 1 root root 12288 Окт 24 12:17 /etc/vsftpd_login.db

auth	required pam_userdb.so db=/etc/vsftpd_login.db
account	required pam_userdb.so db=/etc/vsftpd_login.db
Oct 24 13:12:41 gate vsftpd: pam_userdb(vsftpd:auth): user_lookup: could not open database `/etc/vsftpd_login.db': No such file or directory

ls -la /etc/vsftpd_login.db:

-rw------- 1 root root 12288 Окт 24 12:17 /etc/vsftpd_login.db

да и какая разница какое имя то у этого файла? оно не должно быть буковкозависимым, главное чтобы в pam пути совпадали с реальными.

Acceptor ★★
() автор топика
Ответ на: комментарий от Acceptor

Я в README.gz одним глазом глянул, но как я понял в pam должно быть
pam_userdb.so db=/etc/vsftpd_login

А на диске /etc/vsftpd_login.db

sdio ★★★★★
()
Ответ на: комментарий от sdio

как-то нелогично, но заработало. Ни за что бы не поверил.

Acceptor ★★
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.