systems:media_server:setup_smb_samba_shares
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
systems:media_server:setup_smb_samba_shares [2025/05/30 16:52] – created peter | systems:media_server:setup_smb_samba_shares [2025/07/12 12:46] (current) – [Configure the Samba Share] peter | ||
---|---|---|---|
Line 19: | Line 19: | ||
<file bash / | <file bash / | ||
[Media] | [Media] | ||
+ | comment = Contents are read/write by all. | ||
path = /mnt/media | path = /mnt/media | ||
browseable = yes | browseable = yes | ||
read only = no | read only = no | ||
- | guest ok = no | + | guest ok = yes |
- | valid users = peter | + | force user = root |
+ | force group = root | ||
+ | force directory mode = 0777 | ||
+ | force create mode = 0777 | ||
</ | </ | ||
Line 37: | Line 41: | ||
* **read only = no** - This allows users to write (add, modify, or delete) files in the share. | * **read only = no** - This allows users to write (add, modify, or delete) files in the share. | ||
* If set to yes, the share would be read-only, preventing users from making changes. | * If set to yes, the share would be read-only, preventing users from making changes. | ||
- | * **guest ok = no** - This prevents unauthenticated | + | * **guest ok = yes** - Allow guest users to access |
- | * Only users with valid credentials will be allowed access. | + | * **force user = root** - Allows all file operations to be performed as the root user, regardless of the username used to connect. |
- | * **valid users = peter** - This restricts access to the share to the specified username. | + | * **force group = root** - Force group ownership of the share. |
- | * This is the username | + | * **force directory mode = 0777** - Force all created directories to have read, write and execute permissions |
- | * This ensures only authorized users can access the share. | + | * **force create mode = 0777** - Force all newly created files to have read, write and execute permissions set for everyone. |
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Test the Samba Configuration ===== | ||
+ | |||
+ | <code bash> | ||
+ | testparm | ||
+ | </ | ||
---- | ---- | ||
Line 57: | Line 68: | ||
<WRAP info> | <WRAP info> | ||
**NOTE: | **NOTE: | ||
+ | |||
+ | Samba does not use the system account password, which is why it needs its own password. | ||
+ | |||
+ | * **-a** - This flag adds the existing linux user to the Samba user database. | ||
+ | * This command searches for the username in the Unix user database and adds it to the Samba user database. | ||
+ | * If not found, then the “smbpasswd” command will create as well as add the user to the Samba group. | ||
+ | |||
+ | |||
+ | |||
</ | </ | ||
Line 67: | Line 87: | ||
<code bash> | <code bash> | ||
sudo systemctl restart smbd | sudo systemctl restart smbd | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Check the status of the service to confirm that Samba is working fine ===== | ||
+ | |||
+ | <code bash> | ||
+ | sudo systemctl status smbd | ||
</ | </ | ||
systems/media_server/setup_smb_samba_shares.1748623939.txt.gz · Last modified: 2025/05/30 16:52 by peter