Hi all I hope you can help.

I have set up TLS, vsftp with a pam and mysql backend for authentication, also setup with virtual users.

After much messing about I have it working, or should I say vsftp and mysql logs show no errors and authentication works.

The issue is when you connect you receive a connection failure.

Status: Connecting to 172.16.132.192 ...
Status: Connected with 172.16.132.192, negotiating SSL connection...
Response: 220 ALL ACTIVITY IS LOGGED!
Command: AUTH TLS
Response: 234 Proceed with negotiation.
Status: SSL connection established. Waiting for welcome message...
Command: USER mike
Response: 331 Please specify the password.
Command: PASS ********
Error: Disconnected from server
Error: Unable to connect!

I have tested anonymous_enable=YES and all is well. I have also tested prior to PAM and Mysql, no issue. As you can see below authentication is working but I cannot get to a folder!

my vsftpd.conf
xferlog_file=/var/log/xferlog
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
nopriv_user=vsftpd
chroot_local_user=YES
secure_chroot_dir=/home/vsftpd
pam_service_name=vsftpd
rsa_cert_file=/etc/pki/tls/certs/vsftpd.pem
guest_enable=YES
guest_username=vsftpd
local_root=/home/vsftpd/$USER
user_sub_token=$USER
virtual_use_local_privs=NO
user_config_dir=/etc/vsftpd_user_conf
ftpd_banner=ALL ACTIVITY IS LOGGED!
chroot_local_user=YES
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
listen=YES



My vsftpd log show

Fri Sep 21 14:25:05 2007 [pid 3575] CONNECT: Client "172.16.132.47"
Fri Sep 21 14:25:08 2007 [pid 3574] [mike] OK LOGIN: Client "172.16.132.47"

My Secure log shows

Sep 21 15:34:16 itukftp01 vsftpd: pam_mysql - option verbose is set to "1"
Sep 21 15:34:16 itukftp01 vsftpd: pam_mysql - pam_mysql_close_db() called.
Sep 21 15:34:16 itukftp01 vsftpd: pam_mysql - pam_sm_authenticate() called.
Sep 21 15:34:16 itukftp01 vsftpd: pam_mysql - pam_mysql_converse() called.
Sep 21 15:34:16 itukftp01 vsftpd: pam_mysql - pam_mysql_open_db() called.
Sep 21 15:34:16 itukftp01 vsftpd: pam_mysql - pam_mysql_open_db() returning 0.
Sep 21 15:34:16 itukftp01 vsftpd: pam_mysql - pam_mysql_check_passwd() called.
Sep 21 15:34:16 itukftp01 vsftpd: pam_mysql - pam_mysql_format_string() called
Sep 21 15:34:16 itukftp01 vsftpd: pam_mysql - pam_mysql_quick_escape() called.
Sep 21 15:34:16 itukftp01 last message repeated 3 times
Sep 21 15:34:16 itukftp01 vsftpd: pam_mysql - SELECT pass FROM accounts WHERE username = 'mike'
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_sql_log() called.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_sql_log() returning 0.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_check_passwd() returning 0.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_sm_authenticate() returning 0.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - option user is set to "test"
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - option passwd is set to "test"
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - option host is set to "localhost"
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - option db is set to "vsftpd"
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - option table is set to "accounts"
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - option usercolumn is set to "username"
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - option passwdcolumn is set to "pass"
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - option crypt is set to "0"
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - option verbose is set to "1"
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_close_db() called.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_sm_acct_mgmt() called.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_open_db() called.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_open_db() returning 0.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_query_user_stat() called.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_format_string() called
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_quick_escape() called.
Sep 21 15:34:17 itukftp01 last message repeated 4 times
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - SELECT 0, pass FROM accounts WHERE username = 'mike'
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_sql_log() called.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_sql_log() returning 0.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_query_user_stat() returning 0.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_sm_acct_mgmt() returning 0.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_release_ctx() called.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_destroy_ctx() called.
Sep 21 15:34:17 itukftp01 vsftpd: pam_mysql - pam_mysql_close_db() called.