?
Solved

Locking certain directories

Posted on 2004-04-07
5
Medium Priority
?
323 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 800 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

850 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