Project

General

Profile

Advanced Configuration Options » History » Version 3

Gareth Eaton, 12/16/2023 04:23 PM

1 1 Gareth Eaton
h1. Advanced Configuration Options
2
3 3 Gareth Eaton
Here are some additional options you can include in your Samba share configuration (`[ShareName]`) within the `smb.conf` file to customize the behavior of the share:
4 1 Gareth Eaton
5
1. **Comment:**
6
   - You can add a comment to describe the purpose or usage of the share for documentation purposes:
7 2 Gareth Eaton
     
8
<pre>
9 1 Gareth Eaton
     comment = My Shared Folder
10 2 Gareth Eaton
</pre>
11
   
12 1 Gareth Eaton
13
2. **Browseable:**
14
   - This option controls whether the share is visible and browsable in network neighborhood lists. Set it to "no" to hide the share from network browsing:
15 2 Gareth Eaton
    
16
<pre>
17 1 Gareth Eaton
     browseable = yes
18 2 Gareth Eaton
</pre>
19
    
20 1 Gareth Eaton
21
3. **Public:**
22
   - If you want the share to be accessible without authentication, you can set it as public:
23 2 Gareth Eaton
     
24
<pre>
25 1 Gareth Eaton
     public = yes
26 2 Gareth Eaton
</pre>
27
     
28 1 Gareth Eaton
29
4. **Write List:**
30
   - Specify a list of users who are allowed to write (modify) files in the share:
31 2 Gareth Eaton
     
32
<pre>
33 1 Gareth Eaton
     write list = user1, user2
34 2 Gareth Eaton
</pre>
35
     
36 1 Gareth Eaton
37
5. **Force User and Force Group:**
38
   - You can force a specific user or group ownership on all files and directories within the share:
39 2 Gareth Eaton
     
40
<pre>
41 1 Gareth Eaton
     force user = user1
42
     force group = group1
43 2 Gareth Eaton
</pre>
44
     
45 1 Gareth Eaton
46
6. **Create and Directory Mode:**
47
   - These options allow you to specify the permissions that newly created files and directories will have within the share:
48 2 Gareth Eaton
     
49
<pre>
50 1 Gareth Eaton
     create mask = 0664
51
     directory mask = 0775
52 2 Gareth Eaton
</pre>
53
     
54 1 Gareth Eaton
55
7. **Hide Files and Directories:**
56
   - If you want to hide specific files or directories from users accessing the share, you can use the `hide files` and `veto files` options:
57 2 Gareth Eaton
     
58
<pre>
59 1 Gareth Eaton
     hide files = /somefile.txt
60
     veto files = /lost+found/
61 2 Gareth Eaton
</pre>
62
     
63 1 Gareth Eaton
64
8. **Guest Access:**
65
   - To allow guest access to the share, you can set:
66 2 Gareth Eaton
     
67
<pre>
68 1 Gareth Eaton
     guest ok = yes
69 2 Gareth Eaton
</pre>
70
     
71 1 Gareth Eaton
72
9. **Access-Based Enumeration (ABE):**
73
   - ABE allows you to hide files and directories that a user does not have permission to access. This can enhance security and privacy:
74 2 Gareth Eaton
     
75
<pre>
76 1 Gareth Eaton
     vfs objects = acl_xattr
77
     map acl inherit = yes
78
     store dos attributes = yes
79
     hide unreadable = yes
80 2 Gareth Eaton
</pre>
81
     
82 1 Gareth Eaton
83
10. **Recycle Bin:**
84
    - You can configure a recycle bin for deleted files in the share:
85 2 Gareth Eaton
      
86
<pre>
87 1 Gareth Eaton
      vfs objects = recycle
88
      recycle:repository = .recycle_bin
89
      recycle:keeptree = yes
90
      recycle:versions = yes
91
      recycle:touch = yes
92 2 Gareth Eaton
</pre>
93
      
94 1 Gareth Eaton
95
11. **Guest Only Share:**
96
    - To create a share that is only accessible by guests, you can use:
97 2 Gareth Eaton
     
98
<pre>
99 1 Gareth Eaton
      guest ok = yes
100
      guest only = yes
101 2 Gareth Eaton
</pre>
102
     
103 1 Gareth Eaton
104
12. **Printer Share:**
105
    - If you're sharing a printer, you can specify the printer driver and various printer-related options:
106 2 Gareth Eaton
      
107
<pre>
108 1 Gareth Eaton
      printable = yes
109
      printer name = myprinter
110
      printer driver = hp4l
111 2 Gareth Eaton
</pre>
112
      
113 1 Gareth Eaton
114
These are just some of the many options available for configuring Samba shares in the `smb.conf` file. The options you choose will depend on your specific use case and security requirements. Be sure to consult the Samba documentation and test your configuration thoroughly to ensure it meets your needs.