Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 have CentOS with one ssh user which is root.

How do I make one more user for my web developer so he can scp files over to /var/www/html ? Its gonna be a static page, so mysql and alike are out of question. All I need is that user to be able to scp in and out files of /var/www/html

I tried to add user with home dir as /var/www/html by typing

# adduser -d /var/www/html webdev

1. this user was not able to write files into this dir
2. he is able to browse other directories on the server

share|improve this question
Which solution did you end up using? – Franck Dernoncourt Jan 8 at 17:16

Why not setup a jail? This will restrict a user to a specific directory when they log in. There are a variety of guides on how to do this, so take your pick.

Additionally, you can either add the user to a group that owns the files, or you can chown the files so that anybody can write to them.

share|improve this answer

Your issue is that of permissions. There are many ways to solve the issue. However, since this is for development purposes, the easiest thing to do would be to:

  1. Allow the user to upload files to his/her own home directory (typically ~/public_html).
  2. Allow the web-server access to these files through user directory access.

If you want something with more isolation, I might even recommend something like OpenVZ (over-glorified chroot) to be used to provide the developer with their individual development environments instead.

PS: Remember to restrict the user access by using rssh as the user shell. This limits it to scp/sftp access only.

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.