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 want to create a user on debian which can do following:

  1. Login via SSH.
  2. Create SVN repo and create post-commit hook.
  3. chmod and chown another directory to apache and 777.

How I can achieve that? As far as I see I have several tasks to deal with:

  1. Create user
  2. Enable SSH login for it.
  3. Restrict it's access to several directories and files.
  4. Restrict it's access to several commands.
share|improve this question
You really don't want to chmod 777 anything that apache touches. – Iain May 10 '12 at 6:36
up vote 3 down vote accepted

I would suggest providing more details for a better answer however...

New users have ssh access by default if you use 'adduser'( vs useradd) and fill in the answers. From there you can change the home directory for the user in /etc/passwd . This is assuming you haven't customized your sshd_config file.

As for chowning, I believe your going to need give access to a script or the like via sudoers. I don't believe users can set the OWNER of a file to something other than themselves. Only root.

Limiting commands? Check this . Other options include rbash, chroot, etc.

share|improve this answer
Ok. TY. This seems to be what I was looking for. – Jevgeni Smirnov May 10 '12 at 6:49

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.