Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 08-19-2007, 03:01 PM   #1
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 274

Rep: Reputation: 30
vsftpd and chroot_local_user / issue with linked directory

Hey all,
I have my users when they log in, loggin into:
Within each user folder is a symbolic link to a directory below the users home:
as such:
[root@ftp1 user]$pwd
[root@ftp1 user]$ls -l
total 4
drwxrwxr-x  3 userguest     userguest     4096 Aug 19 14:53 client_ftp
lrwxrwxrwx  1 user user   23 Aug 19 15:40 user_web -> ../www/user_web/
I add in vsftpd.conf the directive:
so that users cant "cd" to higher directories, and see the contents of other directories. HOWEVER when i did this, the directory that i have an a symbolic link failed to work, as it is a directory level higher.

What can I do to prevent users from seeing directories higher "cd ..", but at the same time, allow access to a SINGLE directory via the link??

THanks so much!
Old 08-19-2007, 04:01 PM   #2
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96

It's a short answer: You can't.

If a user is chroot'ed, then they can only see files below the jail directory. Links which point outside the jail won't be traversable.

It might be easier to reverse the link, so that the content exists in the jail, and is linked to from outside.

Old 08-19-2007, 04:10 PM   #3
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 274

Original Poster
Rep: Reputation: 30
I was afraid of that.

Old 08-20-2007, 11:18 AM   #4
Registered: Dec 2006
Distribution: Slackware 11
Posts: 144

Rep: Reputation: 15
There are two ways to work around your problem.

1) Use aufs to create a 'union' mount (

2) Use a 'bind' mount (

Personally I use an aufs implementation, though bind mounting should work. aufs allows filesystems to be overlayed on top of one another which is an easy way to combine the contents of multiple directories into one single directory. 'bind' mounting simply allows a directory to be mounted at another location in the filesystem.

Both will work to accomodate your jail scenario.

::There is hope::


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
vsftpd.conf/chroot/vsftpd.chroot_list issue Jerman Linux - Security 2 06-01-2007 07:24 PM
vsftpd - chroot_local_user=YES is not working madmike_5150 Ubuntu 9 05-24-2007 12:22 AM
konquerror error: you have linked konq to inode/directory ... Tarzan-81 Linux - Software 5 01-13-2006 05:04 AM
vsftpd "chroot_local_user=YES" not working gagda1 Linux - Networking 3 05-12-2004 08:02 PM
How to unlink a directory that is not linked? J_Szucs Linux - Newbie 5 01-09-2003 10:58 PM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:27 PM.

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