Project

General

Profile

Advanced Configuration Options » History » Version 1

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

1 1 Gareth Eaton
h1. Advanced Configuration Options
2
3
Certainly, 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
5
1. **Comment:**
6
   - You can add a comment to describe the purpose or usage of the share for documentation purposes:
7
     ```
8
     comment = My Shared Folder
9
     ```
10
11
2. **Browseable:**
12
   - 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:
13
     ```
14
     browseable = yes
15
     ```
16
17
3. **Public:**
18
   - If you want the share to be accessible without authentication, you can set it as public:
19
     ```
20
     public = yes
21
     ```
22
23
4. **Write List:**
24
   - Specify a list of users who are allowed to write (modify) files in the share:
25
     ```
26
     write list = user1, user2
27
     ```
28
29
5. **Force User and Force Group:**
30
   - You can force a specific user or group ownership on all files and directories within the share:
31
     ```
32
     force user = user1
33
     force group = group1
34
     ```
35
36
6. **Create and Directory Mode:**
37
   - These options allow you to specify the permissions that newly created files and directories will have within the share:
38
     ```
39
     create mask = 0664
40
     directory mask = 0775
41
     ```
42
43
7. **Hide Files and Directories:**
44
   - If you want to hide specific files or directories from users accessing the share, you can use the `hide files` and `veto files` options:
45
     ```
46
     hide files = /somefile.txt
47
     veto files = /lost+found/
48
     ```
49
50
8. **Guest Access:**
51
   - To allow guest access to the share, you can set:
52
     ```
53
     guest ok = yes
54
     ```
55
56
9. **Access-Based Enumeration (ABE):**
57
   - ABE allows you to hide files and directories that a user does not have permission to access. This can enhance security and privacy:
58
     ```
59
     vfs objects = acl_xattr
60
     map acl inherit = yes
61
     store dos attributes = yes
62
     hide unreadable = yes
63
     ```
64
65
10. **Recycle Bin:**
66
    - You can configure a recycle bin for deleted files in the share:
67
      ```
68
      vfs objects = recycle
69
      recycle:repository = .recycle_bin
70
      recycle:keeptree = yes
71
      recycle:versions = yes
72
      recycle:touch = yes
73
      ```
74
75
11. **Guest Only Share:**
76
    - To create a share that is only accessible by guests, you can use:
77
      ```
78
      guest ok = yes
79
      guest only = yes
80
      ```
81
82
12. **Printer Share:**
83
    - If you're sharing a printer, you can specify the printer driver and various printer-related options:
84
      ```
85
      printable = yes
86
      printer name = myprinter
87
      printer driver = hp4l
88
      ```
89
90
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.