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

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
3  
You really don't want to chmod 777 anything that apache touches. –  Iain May 10 '12 at 6:36

1 Answer 1

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 http://stackoverflow.com/questions/402615/how-to-restrict-ssh-users-to-a-predefined-set-of-commands-after-login . 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

 
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.