Hi everybody !!
I am trying to configure a server VSFTPD since 1 week and i don't success

I need your knowledge :P
I put my script little script (there is all configuration for my file):
Code:
deluser --remove-home ftp
mkdir -p /etc/vsftpd/vsftpd_user_conf
cp /etc/vsftpd.conf /etc/vsftpd/vsftpd.old
#### USERS ON SYSTEM
cat /etc/passwd | awk -F: '{print $ 1}' > /etc/vsftpd/user_list
sed -i '/www-data/d' /etc/vsftpd/user_list
#### DB MySQL
echo "CREATE USER ftp_user@localhost IDENTIFIED BY 'web';
GRANT USAGE ON * . * TO ftp_user@localhost IDENTIFIED BY 'web' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
CREATE DATABASE IF NOT EXISTS ftp_user ;
GRANT ALL PRIVILEGES ON ftp_user . * TO ftp_user@localhost;
CREATE TABLE ftp_user.users (name TEXT NOT NULL , pass TEXT NOT NULL ) ENGINE = MYISAM;
INSERT INTO ftp_user.users VALUES ('web',ENCRYPT('test'));" > /etc/vsftpd/mysql_create.sql
cat /etc/vsftpd/mysql_create.sql | mysql -u root -p
############# VSFTPD.CONF ###########################
echo "listen_port=465
connect_from_port_20=no
ftpd_banner=Welcome on my FTP
pam_service_name=vsftpd
listen=yes
anonymous_enable=no
local_enable=yes
#All sys user are lock except www-data
userlist_file=/etc/vsftpd/user_list
userlist_enable=yes
userlist_deny=yes
guest_enable=yes
guest_username=www-data
anon_world_readable_only=no
chroot_local_user=yes
max_clients=50
max_per_ip=4
xferlog_enable=yes
#######################
# SSL (LATER) #
#######################
#ssl_enable=yes
#force_local_data_ssl=yes
#ssl_tlsv1=yes
#ssl_sslv2=yes
#ssl_sslv3=yes
#rsa_cert_file=/etc/vsftpd/vsftpd.pem
##################################
# Configuration au cas par cas #
##################################
user_config_dir=/etc/vsftpd/vsftpd_user_conf" > /etc/vsftpd.conf
################## END VSFTPD.CONF #############################
#### FILE PAM
echo "auth required pam_mysql.so host=localhost user=ftp_user passwd=web db=ftp_user table=users usercolumn=name passwdcolumn=pass crypt=1
account required pam_mysql.so host=localhost user=ftp_user passwd=web db=ftp_user table=users usercolumn=name passwdcolumn=pass crypt=1" > /etc/pam.d/vsftpd
#### CONFIG USER
echo "anon_world_readable_only=NO
local_root=/home/web
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
hide_file=(none)
force_dot_files=YES" > /etc/vsftpd/vsftpd_user_conf/web
#### IS IT RIGHT ?
mkdir /home/web
chown -R www-data:www-data /home/web
chmod -R 755 /home/web
chown -R www-data:www-data /var/www
chmod -R 755 /var/www
echo "/var/www /home/web none bind 0 0" >> /etc/fstab
mount -a
service vsftpd restart
I would like my user web have access to all /var/www. I'm trying to compile vsftpd 3.0 but that doesn't work anymore :/ I'm trying so many thing but i agree to start again step by step with your advice
I find
this solutions too but i don't understand the second way and can i use it if i've got Virutal Users ?
Thank you very much in advance
Quote:
EDIT : My error is :
Response: 220 Welcome on my FTP
Command: USER web
Response: 331 Please specify the password.
Command: PASS ****
Response: 500 OOPS: vsftpd: refusing to run with writable root inside chroot()
Error: Critical error
Error: Could not connect to server
|