updated the 3.0 branch from the head branch - ready for alpha18
[jra/samba/.git] / docs / textdocs / UNIX_SECURITY.txt
1 Contributor:    John H Terpstra <jht@samba.org>
2 Date:           July 5, 1998
3 Status:         Current
4
5 Subject:        SETTING UNIX FILE SYSTEM SECURITY
6 ===============================================================================
7 The following excerpt from a bug report demonstrates the need to
8 understand Unix file system security and to manage it correctly.
9
10 Quote:
11 ======
12 > We are unable to keep individual users from mapping to any other user's
13 > home directory once they have supplied a valid password! They only need
14 > to enter their own password. I have not found *any* method that I can
15 > use to configure samba to enforce that only a user may map their own
16 > home directory.
17
18 > User xyzzy can map his home directory. Once mapped user xyzzy can also map
19 > *anyone* elses home directory!
20
21 ANSWER:
22 =======
23 This is not a security flaw, it is by design. Samba allows
24 users to have *exactly* the same access to the UNIX filesystem
25 as they would if they were logged onto the UNIX box, except
26 that it only allows such views onto the file system as are
27 allowed by the defined shares.
28
29 This means that if your UNIX home directories are set up
30 such that one user can happily cd into another users
31 directory and do an ls, the UNIX security solution is to 
32 change the UNIX file permissions on the users home directories
33 such that the cd and ls would be denied.
34
35 Samba tries very hard not to second guess the UNIX administrators
36 security policies, and trusts the UNIX admin to set
37 the policies and permissions he or she desires.
38
39 Samba does allow the setup you require when you have set the
40 "only user = yes" option on the share, is that you have not set the
41 valid users list for the share.
42
43 Note that only user works in conjunction with the users= list,
44 so to get the behavior you require, add the line :
45
46 users = %S
47
48 this is equivalent to:
49
50 valid users = %S
51
52 to the definition of the [homes] share, as recommended in
53 the smb.conf man page.
54