Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have used vsftpd to create and FTP server. I am using Ubuntu 12.04 desktop version. I want to show directories that are assign to that user only.

For example, I have created users "a","b","c" and groups "developer" and "tester". The users are added in the group as follows:

"a"----> "developer", "tester". "b"----> "developer". "c"----> "tester".

I have created "developerdoc"(owner-root, group-developer) and "testerdoc"(owner-root,group-tester) directory in the /home folder and assign all user's home directory as /home.

Now when I log in with user "a" then it should shows me directory "developerdoc" and "testerdoc" because user a is in the both of these group.

If I log in with user "b" then it should shows me directory "developerdoc" only. The directory "testerdoc" should not listed.

The same is tre for user "c" only "testerdoc" should be listed.

Please guide me how in how I can achieve this.

share|improve this question
add comment

1 Answer 1

I don't think that is possible. As both folders share the same parent folder, and all users should have access to that parent folder, all must have at least read and execute permissions to this parent folder -- and thus can see all files/directories located therein. This is true even if they had no access to some file/subdirectory therein: they could still see (but of course not read/exexute) it.

To make it easier to understand, let me give you a picture: Let's say /home is a "closable street" with a watched entry. So you give somebody permission to pass that entry and walk the street. Though all houses (subdirectories, i.e. /home/*) are closed to him (you didn't give him permission/keys to enter any house), this visitor will still be able to see the houses. He may be unable to enter them -- but you cannot hide them from him while at the same time permitting him to walk the street.

So with this story: If the visitor should not see the houses, don't let him walk the street is the only way. With your directories: The only way to hide them completely, is not to permit entering /home. But why does this bother you, if they cannot enter the other directory (or even tell what is in there)?

share|improve this answer
    
Izzy, yes, if the user have not read/write/execute right access then that directory should not see that user. –  Nitin Jul 20 '12 at 12:50
1  
Maybe you misunderstood: They have the permissions to at least read and execute on /home -- so they can see everything in there. So even if /home/developerdoc is not read/executable for them, it cannot be hidden but will always be executed. Think of it like /home being a street, and /home/* are the houses there: If one is permitted to enter the street, but does not have the key to any of the houses, he will still be able to see the houses (you cannot hide them), though he may be unable to enter any of them. –  Izzy Jul 20 '12 at 16:19
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.