Solved

Locking certain directories

Posted on 2004-04-07
5
303 Views
Last Modified: 2010-04-22
I am running a website, where i would like to give people FTP access, when the user ftps in they start in

/home/%username%

if they wander to /var/www/html they can access all the html thats stored on the site. I dont want them to be able to access these folders, is there anything i can do??
0
Comment
Question by:Matthew Tandy
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:stefan73
ID: 10781388
Use chroot. There are plenty of nice step-by-step explanations on the web for this, just search for "chroot jail".

Here are some examples:
http://www.kegel.com/crosstool/current/doc/chroot-login-howto.html
http://www.geniusweb.com/LDP/HOWTO/Chroot-BIND8-HOWTO.html
0
 
LVL 9

Expert Comment

by:Alf666
ID: 10783101
Just use an ftp server that makes all this right away for you : vsftpd.

http://vsftpd.beasts.org/

You can find RPMs for most distros.
0
 
LVL 1

Author Comment

by:Matthew Tandy
ID: 10783372
Im sure ive done it before with just chmod though, however this time if i chmod the html folder or any others below to 700 it wont let the site work
0
 
LVL 9

Accepted Solution

by:
Alf666 earned 200 total points
ID: 10784085
You can do that in chmod, but that will not secure your whole box. vsftpd is very easy to setup, and stands for "very secure ftp server".

It's been made exactly for what you need.

If you want to chmod, the reason why it won't work is that the user the html folder belongs to is different from the one the httpd is configured to use.

If you chmod 700, then, you should chown to whoever is the httpd user (then, 500 might be better, btw).

To find out, just do :

grep "^User" /etc/httpd/httpd.conf
(or wherever your apache config file is).

0
 
LVL 1

Author Comment

by:Matthew Tandy
ID: 10787067
Got it working now, i made the group apache have access, and the user who is the web master, then chmoded it 750

Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now