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

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

but
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

2 Answers 2

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

 
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.