I
I
Ilya Pavlov2015-07-20 02:51:12
FTP
Ilya Pavlov, 2015-07-20 02:51:12

vsftpd not working (Ubuntu Server)?

Installed VSFTPD on Ubuntu Server 14.04 LTS :
apt-get install vsftpd
Allowed writing to /etc/vsftpd.conf :
write_enable=YES
Created user :
useradd userftp
Password :
passwd userftp
Folder : Folder
mkdir /home/userftp
permissions :
chown userftp /home/userftp
chgrp userftp /home/userftp
When trying to connect, the error is 530 Login failed, but it can be solved by writing to /etc/vsftpd. conf :
pam_service_name=ftp
Instead of :
pam_service_name=vsftpd
Everything works! Connecting, creating/deleting/modifying reading and executing.
But there is one more problem - any user can climb through the directories and go to almost any. To disable this, you need to write in /etc/vsftpd.conf :
chroot_local_user=YES
But then again it is not possible to connect to the server : 500 OOPS: vsftpd: refusing to run with writable root inside chroot()
And this problem can be solved :
chmod a-w /home/userftp
As you can see, we "just" need to disable all users from writing. The problem is solved, but now it is impossible to write. Tried to prohibit all entries except the owner :
chmod a-w /home/userftp
chmod u+w /home/userftp
All the same - an error!
What to do ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mureevms, 2015-07-20
@PiCoderman

This is the security feature of vsftpd - you can not write to the root directory for a hacked user.
If you create a nested one and give it the appropriate rights, then achieve the goal.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question