LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-25-2012, 09:31 AM   #1
Skelray
LQ Newbie
 
Registered: Mar 2012
Posts: 9

Rep: Reputation: Disabled
vsftpd: How to prevent from listing parent directory (not chroot)


I need to block listing of parent directory. I have ftp configured to anonymous connection and set anon_root to /FTP directory.

My directory structure looks like this:
Code:
+ FTP
  + DIR_A
  + DIR_B
Anonymous users should access DIR_A and DIR_B but not parent FTP dir. I need this solution for scenario when users known only one unique directory name and have link for it, but should not "go up" and list other directories.

I hope I've describe my problem enough :-).
 
Old 10-25-2012, 09:06 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
You can't as far as I'm aware .. users can see anything in a directory that they have access to, whether they have permissions to access the file or directory is a different matter.
 
Old 10-25-2012, 11:03 PM   #3
Jc61990
LQ Newbie
 
Registered: Dec 2008
Location: New York
Distribution: Arch
Posts: 18

Rep: Reputation: 0
you could try chmod 111 on the FTP directory and 777 on DIR_A and DIR_B. Taking away all but executable permissions should let the user into the directory but will not be able to read or write to just that directory, but will have full R/W access to DIR A and B. You will need to know the relative path to the dir you want to go into since you will not be able to see anything that is inside the FTP dir.

This is something you can try, i can got guarantee it will work.


edit: I have tested this out and i can confirm this will work.

Root Dir with 777 permissions
http://jc61990.com/images/777.PNG

Root Dir with 111 permissions
http://jc61990.com/images/111.PNG

Manually changing to the dir of my choice by knowing the path
http://jc61990.com/images/111-dir.PNG

Last edited by Jc61990; 10-26-2012 at 09:07 PM.
 
Old 10-27-2012, 06:25 AM   #4
Skelray
LQ Newbie
 
Registered: Mar 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thanks.

I have tried this "configuration" earlier but it wasn't working. You gave me motivation to find out why...

I was using Nautilus (file browser) and it didn't show me those directories (not even when I browse them directly). But with FileZilla or Firefox it works just as was to be.

Last edited by Skelray; 10-27-2012 at 06:27 AM.
 
  


Reply



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
Apache2: Prevent Directory Listing nick1 Linux - Software 10 02-21-2014 04:40 PM
How can I prevent a user from seeing a file in a directory listing? nuspieds Linux - Newbie 4 05-03-2011 11:38 AM
vsftpd directory listing issue BYoungTGS Linux - Server 3 06-13-2010 07:30 AM
vsftpd: no directory listing with remote connection Sjonnie48 Linux - Software 1 11-16-2008 02:09 PM
how to prevent directory listing in apache ? chuck77 Linux - General 7 12-21-2001 03:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:25 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration