I want to create a user on debian which can do following:
- Login via SSH.
- Create SVN repo and create post-commit hook.
- 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:
- Create user
- Enable SSH login for it.
- Restrict it's access to several directories and files.
- Restrict it's access to several commands.
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 https://stackoverflow.com/questions/402615/how-to-restrict-ssh-users-to-a-predefined-set-of-commands-after-login . Other options include rbash, chroot, etc.