Project

General

Profile

Advanced Configuration Options » History » Revision 2

Revision 1 (Gareth Eaton, 12/16/2023 04:20 PM) → Revision 2/3 (Gareth Eaton, 12/16/2023 04:22 PM)

h1. Advanced Configuration Options 

 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: 

 1. **Comment:** 
    - You can add a comment to describe the purpose or usage of the share for documentation purposes: 
     
 <pre> 
      ``` 
      comment = My Shared Folder 
 </pre> 
   

 
      ``` 

 2. **Browseable:** 
    - 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: 
    
 <pre> 
      ``` 
      browseable = yes 
 </pre> 
    

 
      ``` 

 3. **Public:** 
    - If you want the share to be accessible without authentication, you can set it as public: 
     
 <pre> 
      ``` 
      public = yes 
 </pre> 
     

 
      ``` 

 4. **Write List:** 
    - Specify a list of users who are allowed to write (modify) files in the share: 
     
 <pre> 
      ``` 
      write list = user1, user2 
 </pre> 
     

 
      ``` 

 5. **Force User and Force Group:** 
    - You can force a specific user or group ownership on all files and directories within the share: 
     
 <pre> 
      ``` 
      force user = user1 
      force group = group1 
 </pre> 
     

 
      ``` 

 6. **Create and Directory Mode:** 
    - These options allow you to specify the permissions that newly created files and directories will have within the share: 
     
 <pre> 
      ``` 
      create mask = 0664 
      directory mask = 0775 
 </pre> 
     

 
      ``` 

 7. **Hide Files and Directories:** 
    - If you want to hide specific files or directories from users accessing the share, you can use the `hide files` and `veto files` options: 
     
 <pre> 
      ``` 
      hide files = /somefile.txt 
      veto files = /lost+found/ 
 </pre> 
     

 
      ``` 

 8. **Guest Access:** 
    - To allow guest access to the share, you can set: 
     
 <pre> 
      ``` 
      guest ok = yes 
 </pre> 
     

 
      ``` 

 9. **Access-Based Enumeration (ABE):** 
    - ABE allows you to hide files and directories that a user does not have permission to access. This can enhance security and privacy: 
     
 <pre> 
      ``` 
      vfs objects = acl_xattr 
      map acl inherit = yes 
      store dos attributes = yes 
      hide unreadable = yes 
 </pre> 
     

 
      ``` 

 10. **Recycle Bin:** 
     - You can configure a recycle bin for deleted files in the share: 
      
 <pre> 
       ``` 
       vfs objects = recycle 
       recycle:repository = .recycle_bin 
       recycle:keeptree = yes 
       recycle:versions = yes 
       recycle:touch = yes 
 </pre> 
      

 
       ``` 

 11. **Guest Only Share:** 
     - To create a share that is only accessible by guests, you can use: 
     
 <pre> 
       ``` 
       guest ok = yes 
       guest only = yes 
 </pre> 
     

 
       ``` 

 12. **Printer Share:** 
     - If you're sharing a printer, you can specify the printer driver and various printer-related options: 
      
 <pre> 
       ``` 
       printable = yes 
       printer name = myprinter 
       printer driver = hp4l 
 </pre> 
      

 
       ``` 

 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.