Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a server with SSH access. Hope anyone can help me very quickly with permissions. I have a folder, in that folder there are 10 more folders (f1, f2, f3, f4, f5, f6, f7, f8, f9, f10).

I created a user, user1, and I need that user to have acces to folders f1 to f7. So that means folders f8 to f10 shouldn't be accessible or visible for that user.

How can I solve that? Please help me ASAP.

Gr, Ash

share|improve this question
    
Making them not accessible is relatively easy, making them not visible - not sure how to do that - would be interested to find out. –  FreudianSlip Jun 6 '13 at 7:05
    
Do you know then, how to make them not accessible for that user? –  ashiekg Jun 6 '13 at 7:08
1  
Essentially make them owned by someone else (in this case 'root') and make the access to that directory for the User only -> chown root f8; chmod 700 f8 ... –  FreudianSlip Jun 6 '13 at 7:11

2 Answers 2

To make then not accessible just give them root ownership

chown -R root:root f8 ...

and rights:

chmod -R 700 f8

As for visibility , I'm not sure how.

share|improve this answer
    
visibility doesn't matter. no problem. thats out of the picture now. but the all those folders are already owned by an adminuser in a group. it is like this, folders f1-f10 are owned by biztalk1:sapusers. –  ashiekg Jun 6 '13 at 7:17
    
Visibility doesn't matter. no problem. thats out of the picture now. but the all those folders are already owned by an adminuser in a group. It is like this, folders f1-f10 are owned by biztalk1:sapusers. And every folder, for ex: f1 has it's own username called f1 who has access only to folder f1. This is been done through ACL. the user biztalk1 is the user who has full access to all the f1-f10 folders. And now I have created user1 and that user needs read-only access to only folders f1-f7. And the folders f8-f10 shouldn't be accessible for him. That's how it is been taken care off now.. –  ashiekg Jun 6 '13 at 7:24
    
chmod -R 700 ... all the folders you don't want user1 to see, then test it by logging in as him: su user1 and try to cd to that folder. I think he can see the content of that folder with ls but he won't be able to cd or open/edit any of the files –  mirkobrankovic Jun 6 '13 at 7:56
    
I just found the answer... I didn't want to change owner and chmod rights.. And it's solved with: setfacl -m user:user1:rx f1 Many thanks to: Spredzy!! Thanks dude. –  ashiekg Jun 6 '13 at 8:21
    
@ashiekg please post your final solution as an answer. –  terdon Jun 6 '13 at 11:23
 setfacl -m user:user1:rx f1

thats the solution.

where f1 is the foldername.

Oh and the tag "user:" calls up the user, in this case: user1

share|improve this answer

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.