Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I Need new sftp login details for developers but that is restricted to /var/www/html/ using ssh. They have to be able to edit and save files, also when the user makes changes I don't want the group changing to the users group once they make changes, if that makes sense.

share|improve this question
what system is it? – matcheek Jul 4 '13 at 21:45
Centos 6.3, Zend community server on Rackspace Cloud if that's any help. – Joe Moe Jul 5 '13 at 19:01

You could use ACLs here.

Create your user with useradd. Then grant him the correct permission on /var/www/html

#> setfacl -m u:rwx:myuser /var/www/html

Verify that it worked bu using getfacl

#> getfacl /var/www/html

Also for your group name request, you might want to flag the html directory with the setgid flag chmod +s /var/www/html

share|improve this answer

You can create a user with

 useradd -D /var/www/html xyz 

so /var/www/html will be the default home directory for user xyz , but if you are running apache and /var/www/htmlis home directory than this solution is not gonna work.

Instead you should create a user with any other home directory and restrict user with SUDO access for APACHE.

share|improve this answer

I will suggest you to use httpd-itk from epel to run each site by own user. And proftpd (mod_sftp) to gain access to the web root.

share|improve this answer

Your Answer


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.