0

I have hosted a vsftp server on RHEL7. I have multile users who login to the vsftp server. This VSFTP is chrooted. My requirement is that some of the users should landup in their home dir and the rest in specific subfolder inside their home dir. The users who land inside the subfolder should be ABLE to enter their respective home directory.

Example passwd entry for john:

john:x:1234:123:Test account :/ftp/home/john/./test:/etc/ftponly

With the above configuration, when john logs into the VSFTP server he will be placed in the "test" folder in his home directory. But, when I do "cd .." he is not able to enter "/ftp/home/john/" folder.

My Requirement: john should be able to enter /ftp/home/john/ folder. but NOT /ftp/home/

Here is the content of my vsftpd.conf file

anonymous_enable=YES

local_enable=YES

write_enable=YES

local_umask=022

dirmessage_enable=YES

xferlog_enable=YES

connect_from_port_20=YES

xferlog_std_format=YES

listen=NO

listen_ipv6=YES

pam_service_name=vsftpd

userlist_enable=YES

tcp_wrappers=YES

local_enable=YES

allow_writeable_chroot=YES

dual_log_enable=YES

Regards John

0

Although /ftp/home/john/./test is a valid passwd entry, the dot . here assumes no sence

-bash-4.1$ echo $HOME
/home/testuser/./test
-bash-4.1$ pwd
/home/testuser/./test
-bash-4.1$ cd ..
-bash-4.1$ pwd
/home/testuser
-bash-4.1$ cd test
-bash-4.1$ pwd
/home/testuser/test

So home dir of user john is /ftp/home/john/test not /ftp/home/john like you assumes. In order to allow user john to reach /ftp/home/john you need to set its home folder to /ftp/home/john (or higher). In vsftpd (and mostly generally) chrooted users cannot get higher than their homes.

  • Thanks for the quick reply. The reason why I put "." dot is that, we have legacy system running wu ftp where the user logs into the test folder when he gives username and password. He can do "cd .." and enter his home directory.But, he cannot go beyond his home directory. I wanted the same setup to be replicated in vsftpd but didn't find any technique to achieve this. Hence I posted to see if there was a work around. Thanks for your reply once again!! – John Pereira Aug 17 '16 at 4:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.