2

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

1
  • Which solution did you end up using? Commented Jan 8, 2016 at 17:16

2 Answers 2

1

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.

1

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.