LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 04-13-2010, 08:19 AM   #1
malesef
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Rep: Reputation: 0
Exclamation FTP directory is open???


Hey all
I have question if you dont mind mee ask.
I have apache, ftp and mysql installed in centos.
Apache gets the user name and password on screen , checks with mysql and opens ftp to user
however if I type the http : // ip address/ftp/ I am able to access all data without entering user and password which is kind of an open gate that we do not want.
basically user ftp directory is /var/www/ftp and whoever types my server url and adds /ftp , he is able to see all ftp content. I do not know it is apache or ftp user issue

I think I am missing somethings.
Do you guys have any idea about that?
all suggestions are more than welcome.
thank you in advance
 
Old 04-13-2010, 08:57 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
Have you closed the browser after entering the user name and password ?

The browser will remember them if you don't.
 
Old 04-13-2010, 09:15 AM   #3
malesef
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Original Poster
Rep: Reputation: 0
firstly thanks for reply.
I close,deleted the temp , even tried from a different computer.
I do not even need to enter user or password.
it is just automatically showing all the users and passwords data
normally all the ftp user's folders are inside of /var/www/ftp directory.
without user/pass they can't log in
but somehow if I type the ipaddress/ftp, I am seeing all the user's folders in /var/www/ftp.
please heelp?
thanks
 
Old 04-13-2010, 09:28 AM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
What do you mean by 'opens ftp to user'? What condition changes to make ftp 'open', as opposed to some other state? How does the URL 'http://ip address/ftp/', regulate what users are permitted to access it? It appears that you may be confusing access control by two different protocols. The ftp server and the HTTP server do not normally interact. As far as I know, FTP inherits user permissions from the underlying filesystem.
--- rod.
 
Old 04-13-2010, 09:45 AM   #5
malesef
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Original Poster
Rep: Reputation: 0
ok,let me state this way.
lets say you have ftp server name called linuxftp. com
and
when you type http: //linuxftp. com , page is opening and asking for user and password which has been created before by admin
so far that is controlled by apache and mysql I guess.
if user enters right password, new page opening for user and user getting able to download or upload data to server.this can be either and ftp software or directly browser.
that is working fine so far

however, if I type http: //linuxftp. com /ftp/ , without any user and password,
I am seeing all others user contents which is basically I am seeing ftp directory.

please kindly let me know, if you have any questions about the achitecture
I appreciate
 
Old 04-13-2010, 11:56 AM   #6
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
This sounds more like you don't have directory protection configured correctly (via Apache). It looks like when you're going to http: //linuxftp. com /ftp/, it is bypassing authentication. Are you sure you've set up htaccess correctly?
 
Old 04-13-2010, 12:30 PM   #7
malesef
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Original Poster
Rep: Reputation: 0
thanks for the reply.
I just checked
.htaccess securing another directory actually
can I copy the same .htaccess inside of this folder to make it secure?
 
Old 04-13-2010, 12:56 PM   #8
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
I don't know if that'll work. I'd follow the same steps you used to secure the initial directory.
 
Old 04-14-2010, 08:11 AM   #9
malesef
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Original Poster
Rep: Reputation: 0
thank you
problem was with apache disabling directory listing/browsing
httpd.conf
To disable directory listing
Options Indexes FollowSymLinks
I just removed ‘Indexes’ from the line.
I appreciate for your replies guys
 
Old 04-14-2010, 09:00 AM   #10
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
You'd think that establishing directory protection would outright prevent directory listing/browsing, even if the config file for Apache had directory listing enabled.

In the upper posts, you confirmed that htaccess wasn't configured correctly. You also mentioned in a later post that httpd.conf was enabling directory listing which was the problem. Which was the actual issue?
 
Old 04-14-2010, 10:04 AM   #11
malesef
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Original Poster
Rep: Reputation: 0
actual problem is solved by disabling directory listing.
.htaccess would be another way to do it I guess.
thanks
 
Old 04-14-2010, 11:49 AM   #12
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
IMO, applying both changes (to the .htaccess and .conf files) would help. If you didn't use .htaccess to seal off the directory but are relying on hiding the directory content by disabling directory listings, you're using the 'security by obscurity' method, which may get you into trouble later...IMO. Getting the same result as locking down the directory by hiding the directory content doesn't mean that the directory is secure.

If you're happy with the result, I guess that's OK, but its the wrong way to go about things.
 
Old 04-14-2010, 12:15 PM   #13
malesef
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Original Poster
Rep: Reputation: 0
I understand, you are %100 right.
but if I protect that folder with .htaccess, how are the users gonna access that?
users are accessing that folder with their individual user and passwords right, if I add .htaccess, are they still gonna be able to access with their individual password?
because that folder is protected with scripts,not with .htaccess.
or another question if you know the file name now,
http://ipaddress/ftp/filename
you can still access , is there any way to disable it in apache?
thank you
 
Old 04-14-2010, 12:40 PM   #14
bakdong
Member
 
Registered: Apr 2009
Posts: 214

Rep: Reputation: 44
I'm wondering why your ftp directory is in the www tree at all. Are you sure this is necessary?
 
Old 04-14-2010, 01:28 PM   #15
malesef
LQ Newbie
 
Registered: Apr 2010
Posts: 8

Original Poster
Rep: Reputation: 0
you are right should not be in that directory,but it has been set up like that, and I cant play with existing system that much
 
  


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
ftp user can't create a directory on ftp server bharatlalgupta Red Hat 4 01-27-2010 01:58 PM
change default vsftp anonymous accout directory /var/ftp to other directory? hocheetiong Linux - Newbie 2 01-24-2010 06:33 PM
Automatically Copying files from the ftp directory into the html directory swatward Linux - General 3 04-17-2005 10:55 PM
SuSE 9.2 - FTP Port open with no FTP service?!?! don_wombat Linux - Security 12 12-01-2004 03:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:30 PM.

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