LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (http://www.linuxquestions.org/questions/ubuntu-63/)
-   -   vsftpd - chroot_local_user=YES is not working (http://www.linuxquestions.org/questions/ubuntu-63/vsftpd-chroot_local_user%3Dyes-is-not-working-554410/)

madmike_5150 05-16-2007 02:42 PM

vsftpd - chroot_local_user=YES is not working
 
Guys,

I am running Ubuntu 6.10 server

I have been unable for the last day or so to get VSFTPd to chroot jail each user into their home dir. here is my vsftpd.conf file

==========================
listen=YES
local_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
idle_session_timeout=600
data_connection_timeout=120
tpd_banner=Welcome to mikes company sFTP service. Play nice!
chroot_local_user=YES
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
===========================

according to the FAQ for vsftpd and other sites all I have to do is add the following line to my vsftpd.conf file (as you can see it is already there)

"chroot_local_user=YES"


users are still able to browse up the directory tree.

Please help.

Thanks

MadMike

Wim Sturkenboom 05-17-2007 06:56 AM

Maybe a very silly suggestion, but did you restart the service?

madmike_5150 05-17-2007 11:34 AM

Quote:

Originally Posted by Wim Sturkenboom
Maybe a very silly suggestion, but did you restart the service?

great question and suggestion and yes the service was restarted several time as well as the server.

MadMike

madmike_5150 05-17-2007 02:21 PM

In addition to the vsftpd.conf used above, I have tried several other options including the one found here http://www.linuxquestions.org/questi...d.php?t=180750

To no avail.

If anyone has any experience with this issue, please help.

Thanks!

MadMike

0.o 05-17-2007 03:38 PM

Quote:

Originally Posted by madmike_5150
In addition to the vsftpd.conf used above, I have tried several other options including the one found here http://www.linuxquestions.org/questi...d.php?t=180750

To no avail.

If anyone has any experience with this issue, please help.

Thanks!

MadMike


Do you have these directives enabled and populated?
http://vsftpd.beasts.org/vsftpd_conf.html

Quote:

chroot_list_file
The option is the name of a file containing a list of local users which will be placed in a chroot() jail in their home directory. This option is only relevant if the option chroot_list_enable is enabled. If the option chroot_local_user is enabled, then the list file becomes a list of users to NOT place in a chroot() jail.

Default: /etc/vsftpd.chroot_list

madmike_5150 05-17-2007 04:54 PM

Quote:

Originally Posted by 0.o
Do you have these directives enabled and populated?
http://vsftpd.beasts.org/vsftpd_conf.html

Here is the modified config based on your suggestions and the ones that i have already tried.
=======================
listen=YES
local_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
idle_session_timeout=600
data_connection_timeout=120
tpd_banner=Welcome to mikes company sFTP service. Play nice!
#chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
========================

Located in the file /etc/vsftpd.chroot_list is the usernames that I WANT to be chrooted.

Once this config was applied and the service was restarted, those users can still successfully browse out of their home dirs.

MadMike

0.o 05-21-2007 01:25 PM

What does the list of users look like?

ithawtewrong 05-21-2007 10:33 PM

Here's some info for ya. Please note the chroot_list_enable option:

From the vsftpd.conf config file provided at install.

Code:

# You may restrict local users to their home directories.  See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.
#chroot_local_user=YES
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd.chroot_list

How did you install vsftp on Ubuntu? I did the aptitude install vsftpd and it worked fine and the config file was commented with all the info I needed.

madmike_5150 05-23-2007 11:50 AM

Guys,

After speaking to one of my team members, the issue is now determined to be caused by users logging in with SFTP versus FTP. You have to love communication!

Anyway all is well once again. Users that log into VSFTPd with FTP clients are indeed locked down in their home dirs.

MadMike


Quote:

Originally Posted by ithawtewrong
Here's some info for ya. Please note the chroot_list_enable option:

From the vsftpd.conf config file provided at install.

Code:

# You may restrict local users to their home directories.  See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.
#chroot_local_user=YES
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd.chroot_list

How did you install vsftp on Ubuntu? I did the aptitude install vsftpd and it worked fine and the config file was commented with all the info I needed.


Wim Sturkenboom 05-24-2007 01:22 AM

I suppose that I don't have to suggest that you disable the sFTP in the ssh server config.


All times are GMT -5. The time now is 06:35 AM.