To summarise the problem:
I have vsftpd installed on a Leap 42.3 machine and setup for virtual users with pam_pwdfile.
I use ftp in bash on the same machine to access the vfstpd server on localhost. I use a welcome banner to be sure I connect to the correct FTP server.
With ‘anonymous_enable=yes’ in /etc/vsftpd.conf, I can login:
Mon Apr 23 08:28:03 2018 [pid 8917] CONNECT: Client “127.0.0.1”
Mon Apr 23 08:28:03 2018 [pid 8917] FTP response: Client “127.0.0.1”, "220 “experimental FTP service on EPC353"”
Mon Apr 23 08:28:03 2018 [pid 8917] FTP command: Client “127.0.0.1”, “USER anonymous”
Mon Apr 23 08:28:03 2018 [pid 8917] [anonymous] FTP response: Client “127.0.0.1”, “331 Please specify the password.”
Mon Apr 23 08:28:11 2018 [pid 8917] [anonymous] FTP command: Client “127.0.0.1”, “PASS <password>”
Mon Apr 23 08:28:11 2018 [pid 8916] [ftp] OK LOGIN: Client “127.0.0.1”, anon password “rewt”
Mon Apr 23 08:28:11 2018 vsftpd [pid 8918]: “ftp” from “127.0.0.1”: cannot change directory:/ftpdataMon Apr 23 08:28:48 2018 [pid 8925] CONNECT: Client “1
27.0.0.1”
Mon Apr 23 08:28:48 2018 [pid 8925] FTP response: Client “127.0.0.1”, "220 “experimental FTP service on EPC353"”
Mon Apr 23 08:28:48 2018 [pid 8925] FTP command: Client “127.0.0.1”, “USER anonymous”
Mon Apr 23 08:28:48 2018 [pid 8925] [anonymous] FTP response: Client “127.0.0.1”, “331 Please specify the password.”
Mon Apr 23 08:28:51 2018 [pid 8925] [anonymous] FTP command: Client “127.0.0.1”, “PASS <password>”
Mon Apr 23 08:28:51 2018 [pid 8924] [ftp] OK LOGIN: Client “127.0.0.1”, anon password “rewt”
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, “230 Login successful.”
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP command: Client “127.0.0.1”, “SYST”
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, “215 UNIX Type: L8”
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP command: Client “127.0.0.1”, “FEAT”
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, “211-Features:”
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, " EPRT^M
"
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, " EPSV^M
"
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, " MDTM^M
"
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, " PASV^M
"
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, " REST STREAM^M
"
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, " SIZE^M
"
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, " TVFS^M
"
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, " UTF8^M
"
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, “211 End”
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP command: Client “127.0.0.1”, “PWD”
Mon Apr 23 08:28:51 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, “257 “/””
Mon Apr 23 08:28:53 2018 [pid 8926] [ftp] FTP command: Client “127.0.0.1”, “EPSV”
Mon Apr 23 08:28:53 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, “229 Entering Extended Passive Mode (|||10072|).”
Mon Apr 23 08:28:53 2018 [pid 8926] [ftp] FTP command: Client “127.0.0.1”, “LIST”
Mon Apr 23 08:28:53 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, “150 Here comes the directory listing.”
Mon Apr 23 08:28:53 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, “226 Directory send OK.”
Mon Apr 23 08:28:56 2018 [pid 8926] [ftp] FTP command: Client “127.0.0.1”, “QUIT”
Mon Apr 23 08:28:56 2018 [pid 8926] [ftp] FTP response: Client “127.0.0.1”, “221 Goodbye.”
With ‘anonymous_enable=no’ in /etc/vsftpd.conf, and
‘auth required pam_permit.so’ in /etc/pam.d/vsftpd I can not login:
Mon Apr 23 08:29:47 2018 [pid 8944] CONNECT: Client “127.0.0.1”
Mon Apr 23 08:29:47 2018 [pid 8944] FTP response: Client “127.0.0.1”, "220 “experimental FTP service on EPC353"”
Mon Apr 23 08:29:47 2018 [pid 8944] FTP command: Client “127.0.0.1”, “USER NIEDE”
Mon Apr 23 08:29:47 2018 [pid 8944] [NIEDE] FTP response: Client “127.0.0.1”, “331 Please specify the password.”
Mon Apr 23 08:29:53 2018 [pid 8944] [NIEDE] FTP command: Client “127.0.0.1”, “PASS <password>”
Mon Apr 23 08:29:55 2018 [pid 8943] [NIEDE] FAIL LOGIN: Client “127.0.0.1”
Mon Apr 23 08:29:56 2018 [pid 8944] [NIEDE] FTP response: Client “127.0.0.1”, “530 Login incorrect.”
Mon Apr 23 08:29:59 2018 [pid 8944] FTP command: Client “127.0.0.1”, “QUIT”
Mon Apr 23 08:29:59 2018 [pid 8944] FTP response: Client “127.0.0.1”, “221 Goodbye.”
Mon Apr 23 08:30:06 2018 [pid 8947] FTP response: Client “127.0.0.1”, “221 Goodbye.”
With ‘anonymous_enable=no’ in /etc/vsftpd.conf, and
‘auth required pam_pwdfile.so debug pwdfile=/etc/vsftpd/.passwd’ in /etc/pam.d/vsftpd I can not login either.
I want this last setting to work.
My /etc/vsftpd.conf looks like this:
ftpd_banner="experimental FTP service on EPC353"
write_enable=NO
dirmessage_enable=YES
hide_ids=YES
chmod_enable=NO
cmds_denied=RMD
local_enable=yes
local_umask=066
chroot_local_user=NO
secure_chroot_dir=/usr/share/empty
allow_writeable_chroot=YES
anonymous_enable=NO
anon_root=/usr/share/empty
anon_world_readable_only=YES
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
guest_enable=YES
guest_username=virtual
user_config_dir=/etc/vsftpd_user_conf
xferlog_enable=YES
vsftpd_log_file=/var/log/vsftpd.log
log_ftp_protocol=yes
connect_from_port_20=YES
pam_service_name=vsftpd
userlist_enable=YES
userlist_file=/etc/vsftpd.user_list
listen=YES
listen_port=21
ssl_enable=NO
ssl_sslv2=NO
ssl_sslv3=NO
ssl_tlsv1=no
I would like some advise on how to find the cause (and fix the problem).