Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Suppose I have the following directories inside my www folder:

private_info_1
public_info_1
private_info_2
public_info_2

Is it possible to create an FTP user (I'm using cPanel) that could access the two public directories, but not the private directories?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

There are two common ways of doing this. The preferred method requires more access than you are likely to have via cPanel and is called "FTP jail". The second (simpler method) is to set the permissions of the private folders to deny access. Most commonly this is done by setting the permissions of the private folders to 750 or 770 and the folder's group to one that the user is not a member.

sudo chmod 750 private_info_1 private_info_2
sudo chgrp {private group} private_info_1 private_info_2

If the private info folders will only ever be accessed by a single user use chmod 700 to deny everyone else.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.