LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-29-2014, 10:23 PM   #1
srijur
LQ Newbie
 
Registered: Mar 2014
Posts: 1

Rep: Reputation: Disabled
[VSFTPD] 500 OOPS: vsftpd: refusing to run with writable root inside chroot()


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

Last edited by srijur; 03-29-2014 at 10:28 PM. Reason: forgot informations
 
Old 03-31-2014, 04:10 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,962

Rep: Reputation: 1904Reputation: 1904Reputation: 1904Reputation: 1904Reputation: 1904Reputation: 1904Reputation: 1904Reputation: 1904Reputation: 1904Reputation: 1904Reputation: 1904
Hi,

With vsftpd-3.x you should use:
Code:
allow_writeable_chroot=YES
Regards
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] 500 OOPS chroot error in vsftpd SarahGurung Linux - Newbie 7 03-30-2014 11:58 PM
500 OOPS: could not read chroot() list file:/etc/vsftpd/chroot_list yarzar Linux - Newbie 1 04-27-2013 06:13 AM
[SOLVED] 500 OOPS: vsftpd: refusing to run with writable anonymous root: Anonymous Login sanjay87 Linux - Server 5 08-14-2012 01:28 AM
500 OOPS: could not open chroot() list file:/etc/vsftpd/chroot_list sunrised24 Linux - Server 1 02-16-2012 09:34 AM
vsftpd error: refusing to run with writable anonymous root abd_bela Debian 2 04-15-2008 05:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration