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 am trying to find out how to create ssh users that can work inside my sites directories but not have complete access except for the folders I specify.

The only issue is that I need the sub-users not to create privledge issues. It's like I want a site owner to act like root when it deals with anything in his site folder, created by him or the other workers.

Any suggestions on a stable solution?

Thanks

share|improve this question
    
did you look at chroot environments? –  Dmitri Chubarov Apr 24 '12 at 17:17
    
not really needing that much. the problem I am having now is that I created a home directory for the user, then created links to the folders I want them to have. The problem is they are writing with permission +755 and permission denied when I try to overwrite. –  RichardW11 Apr 24 '12 at 18:42
1  
Have you considered using ACLs? –  fpmurphy1 Apr 24 '12 at 22:14
    
+fpmurphy this was a good read thanks. –  RichardW11 Apr 25 '12 at 1:36
    
have you check into groups, setuid (in directories) or, for changing the permission, changing the umask for those users ? –  Feiticeir0 Apr 25 '12 at 10:17
add comment

1 Answer

up vote 1 down vote accepted

Make the primary group the same for all of these users

usermod -g users user1
usermod -g users user2
# (etc)

Set the umask for each user to 0002

echo 'umask 0002' >> ~user1/.bashrc
echo 'umask 0002' >> ~user2/.bashrc
# (etc)

Change ownership of files in existing shared directories

find /dat -exec chgrp -R users * \;
find /dat -exec chmod -R g+w * \;

Now, files will be created with group "users" and mode 0775. Your users can overwrite each others files.

share|improve this answer
add comment

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.