LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 06-16-2007, 01:47 AM   #1
60s TV Batman
Member
 
Registered: Oct 2004
Location: London (UK)
Distribution: Ubuntu 12.04
Posts: 60

Rep: Reputation: 17
vsftpd chroot, want to allow a directory from elsewhere


I have an FTP user set up that is chroot'd to his own directory. This is set up in vsftpd. The user has no shell (/dev/null), so no ssh access, but does have a home directory (/home/ftp/user/)

This is all working just fine.

But I'd like to also give the user access to his own web directory (e.g. /var/www/html/user/).

I created a symbolic link from within the user's own FTP directory (/home/ftp/user/symboliclink). The link shows up in FTP, but can't be clicked on (no doubt due to chroot).

Is there a way to make an exception for the symbolic link?

Specifically, the user should be able to access the /var/www/html/user/ directory via the symbolic link.

The user should not be able to see everything below his own html/user/ directory, but nothing above it.
 
Old 06-16-2007, 04:36 AM   #2
p_s_shah
Member
 
Registered: Mar 2005
Location: India
Distribution: RHEL 3/4, Solaris 8/9/10, Fedora 4/8, Redhat Linux 9
Posts: 228
Blog Entries: 1

Rep: Reputation: 34
Why dont you change user's home directory from /home/ftp/user to /var/www/html/user instead of creating symbolic link ?
 
Old 06-16-2007, 04:39 AM   #3
60s TV Batman
Member
 
Registered: Oct 2004
Location: London (UK)
Distribution: Ubuntu 12.04
Posts: 60

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by p_s_shah
Why dont you change user's home directory from /home/ftp/user to /var/www/html/user instead of creating symbolic link ?
Because this user needs to be able to download database backups, and I don't want those files online
 
Old 06-16-2007, 08:37 AM   #4
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
What about creating an html directory inside the user's home directory, and then making a symbolic link to that inside the www directory?
 
Old 06-16-2007, 08:43 AM   #5
60s TV Batman
Member
 
Registered: Oct 2004
Location: London (UK)
Distribution: Ubuntu 12.04
Posts: 60

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by Gethyn
What about creating an html directory inside the user's home directory, and then making a symbolic link to that inside the www directory?
Nice idea.

Tried it, and ran into the same problem with the files in my includes directory. These are in a different tree to apache's root.

I don't want my generic includes directory inside this client's FTP tree.

Hmmmm....

Last edited by 60s TV Batman; 06-16-2007 at 08:58 AM.
 
Old 06-16-2007, 08:59 AM   #6
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
Okay, that's the setup I use on my server. If you're using apache, You may need to add "Options FollowSymLinks" in suitable places in your httpd.conf.
 
  


Reply


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 and chroot bstempi Linux - Security 10 11-08-2005 02:56 PM
vsftpd and chroot gbj Linux - Networking 3 03-08-2005 02:47 AM
vsftpd chroot and Apache R4z0r Linux - Networking 1 09-19-2003 01:01 PM
vsftpd home directory and chroot avante Linux - Networking 4 03-17-2003 01:56 AM


All times are GMT -5. The time now is 07:13 PM.

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