Protecting the directory tree


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Protecting the directory tree
# 1  
Old 02-16-2008
Protecting the directory tree

Hello, I am hoping someone maybe able to help me.
I have set up an Apache web server on my sun server with user accounts in the main htdocs directory. My question is how to stop these users searching up the directory tree when they ftp/telnet to the server. Also is it possible to restrict the commands they have access to? For example only let them have ls, cd, mkdir, rm.
I am using a sun sparc with solaris 8 installed, Apache 2.2.6.
Thank you for any help given.
# 2  
Old 02-17-2008
If you give user's read/write access to subdirs of htdocs, you had better trust them. Otherwise you are allowing them to run arbitrary code as the apache user (this might be ok of course if you have set up apache so that the user running it has the minimum access).
Generally speaking, it's a better idea to allocate a seperate area for user's home dirs.

If you really have to do it this way though, you only need to grant execute access to the parent directories of htdocs. Leave off the read-access bit and they will only be able to change into the dirs, not read the contents.
eg
/ root root drwxr-xr-x
/export root root drwx--x--x
/export/htdocs root root drwx--x--x
/export/htdocs/user1 user1 httpusers drwxr-xr-x
/export/htdocs/user2 user2 httpusers drwxr-xr-x
# 3  
Old 02-17-2008
Do you really need to allow them telnet ( or more generally shell ) access. If not, then disbale shell access for the users, switch to wu-ftp or vsftp, turn on the home directory jail function of the ftp daemon and that should be it.

There are other concerns that you should consider as the previous post indicated. I would never consider giving users access to a folder under the web root, apache has other functionality which you can use to achieve the same thing.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Specific directory parsing in a directory tree

Hi friends, Hello again :) i got stuck in problem. Is there any way to get a special directory from directory tree? Here is my problm.." Suppose i have one fix directory structure "/abc/xyz/pqr/"(this will be fix).Under this directory structure i have some other directory and... (6 Replies)
Discussion started by: harpal singh
6 Replies

2. UNIX for Dummies Questions & Answers

Protecting a folder/directory against root access.

A friend and I run a vbulletin forum which recently got hacked. We believe what wound up happening was the attacker gained access to the VPS box and from there elevated their user accounts to admin status on our forums. Obviously if someone gets into our box in the future it'll be a disaster so... (1 Reply)
Discussion started by: fannypack
1 Replies

3. UNIX for Dummies Questions & Answers

directory tree with directory size

find . -type d -print 2>/dev/null|awk '!/\.$/ {for (i=1;i<NF;i++){d=length($i);if ( d < 5 && i != 1 )d=5;printf("%"d"s","|")}print "---"$NF}' FS='/' Can someone explain how this works..?? How can i add directory size to be listed in the above command's output..?? (1 Reply)
Discussion started by: vikram3.r
1 Replies

4. Shell Programming and Scripting

creating a directory tree

Hi all, I'd like to create a directory tree, and define from stdin how many levels deep and how many directories in each level should be created. What I wrote does not work properly:#!/bin/bash #set -x read -p " What root directory? " rootDir && { /bin/rm -R $rootDir; mkdir $rootDir; } ||... (2 Replies)
Discussion started by: NBaH
2 Replies

5. UNIX for Dummies Questions & Answers

Password protecting a directory

Hi, Is there a way to password protect a dir in linux ?? I need to protect the tmp folder of a JBoss server instance running on Linux RedHat os. I cannot change permissions cause, the root password is shared and a number of people login via that. also if possible can i restrict the root... (2 Replies)
Discussion started by: akshay61286
2 Replies

6. UNIX for Dummies Questions & Answers

Move all files in a directory tree to a signal directory?

Is this possible? Let me know If I need specify further on what I am trying to do- I just want to spare you the boring details of my personal file management. Thanks in advance- Brian- (2 Replies)
Discussion started by: briandanielz
2 Replies

7. Shell Programming and Scripting

directory tree

Hi all, The following is a script for displaying directory tree. D=${1:-`pwd`} (cd $D; pwd) find $D -type d -print | sort | sed -e "s,^$D,,"\ -e "/^$/d"\ -e "s,*/\(*\)$,\:-----\1,"\ -e "s,*/,: ,g" | more exit 0 I am trying to understand the above script.But... (3 Replies)
Discussion started by: ravi raj kumar
3 Replies

8. Programming

directory as tree

hi i have modified a program to display directory entries recursively in a tree like form i need an output with the following guidelines: the prog displays the contents of the directory the directory contents are sorted before printing so that directories come before regular files if an entry... (2 Replies)
Discussion started by: anything2
2 Replies

9. UNIX for Dummies Questions & Answers

password protecting a directory

I need to password protect a particular file on one of my websites. Is it possible to password protect the entire directory? Or can I only password protect one file. How do I do this? Does it have to do with the .HTACCESS file on my unix server? Please Help! ~ :confused: ~ (2 Replies)
Discussion started by: iriemember
2 Replies
Login or Register to Ask a Question