Activities

September 2013
M T W T F S S
« Aug   Oct »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

vsftpd: refusing to run with writable root inside chroot()

Recently I had to install Ubuntu Server 13.04 on a hardware since none of the other operating systems support this hardware. I got this error “vsftpd: refusing to run with writable root inside chroot()” when I’m trying to connect a user ftp account and connection does not established.

Google showing lots of threads having similar errors. But this does not fix my problem since all them are saying to add “allow_writeable_chroot=YES” in vsftpd.conf file even though I have enabled “chroot_local_user=YES” in it.

Note : There is no need to add “allow_writeable_chroot=YES” in config and ftp will not start after that 🙁

Finally I found the issue, it is something related to home directory permission. Ftp daemon does not establish a connection to a home directory which is having write access to that user.

Solution

Execute this command

# chmod a-w /home/<user name>

See the folder permissions,

[root@web-test1 ~]# ls -ls /home/
 4 drwx------  3 liju       liju       4096 Sep  3 15:03 liju
[root@web-test1 ~]# chmod a-w /home/liju/
[root@web-test1 ~]# ls -ls /home/
 4 dr-x------  3 liju       liju       4096 Sep  3 15:03 liju

This command simply remove the write permission associate with that home folder.

Note: you may need to create all other folders for your requirements and grant permission respectively. ie if you wish to upload files to your web folder, you may need to execute chomod -R 775 against that folder.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>