Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| samba_share [2025/05/14 11:06] – [3. Configure Samba (smb.conf)] kkaragoz | samba_share [2025/05/14 15:36] (current) – [7.1. Windows] kkaragoz | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| ===== 2. Create the Folder to Share ===== | ===== 2. Create the Folder to Share ===== | ||
| - | Decide on a location for your shared folder. A common place for service data is the //< | + | Decide on a location for your shared folder. A common place for service data is the '' |
| - | Create the folder (e.g., | + | Create the folder (e.g., |
| <code bash> | <code bash> | ||
| sudo mkdir -p / | sudo mkdir -p / | ||
| </ | </ | ||
| - | Set appropriate permissions. For a share where multiple users might read and write, you can create a dedicated group (e.g., | + | Set appropriate permissions. For a share where multiple users might read and write, you can create a dedicated group (e.g., |
| //Optional: Create a group for Samba users// | //Optional: Create a group for Samba users// | ||
| Line 34: | Line 34: | ||
| </ | </ | ||
| - | **Note:** // | + | **Note:** // |
| ===== 3. Configure Samba (smb.conf) ===== | ===== 3. Configure Samba (smb.conf) ===== | ||
| - | The main Samba configuration file is located at < | + | The main Samba configuration file is located at '' |
| ==== 3.1. Backup the Original Configuration File ==== | ==== 3.1. Backup the Original Configuration File ==== | ||
| Line 49: | Line 49: | ||
| ==== 3.2. Edit the Configuration File ==== | ==== 3.2. Edit the Configuration File ==== | ||
| - | Open //< | + | Open '' |
| <code bash> | <code bash> | ||
| sudo nano / | sudo nano / | ||
| Line 74: | Line 74: | ||
| </ | </ | ||
| - | * //< | + | * '' |
| - | * //< | + | * '' |
| - | * //< | + | * '' |
| - | * //< | + | * '' |
| - | * //< | + | * '' |
| - | * //< | + | * '' |
| - | * //< | + | * '' |
| - | * //< | + | * '' |
| ==== 3.4. Example 2: Secure Share with User Authentication (Recommended) ==== | ==== 3.4. Example 2: Secure Share with User Authentication (Recommended) ==== | ||
| Line 87: | Line 87: | ||
| This is the recommended approach for most situations, as it provides better security. | This is the recommended approach for most situations, as it provides better security. | ||
| - | First, ensure the Linux user(s) who will access the share exist on the Debian server. If not, create them using //< | + | First, ensure the Linux user(s) who will access the share exist on the Debian server. If not, create them using '' |
| <code bash> | <code bash> | ||
| sudo adduser shareuser_example | sudo adduser shareuser_example | ||
| </ | </ | ||
| - | (Replace | + | (Replace |
| Next, add this Linux user to Samba' | Next, add this Linux user to Samba' | ||
| Line 98: | Line 98: | ||
| </ | </ | ||
| - | Now, add the following share definition to your //< | + | Now, add the following share definition to your '' |
| <file ini> | <file ini> | ||
| [SecureShare] | [SecureShare] | ||
| Line 112: | Line 112: | ||
| </ | </ | ||
| - | * //< | + | * '' |
| - | * Ensure that the Linux file permissions on the shared directory (//< | + | * Ensure that the Linux file permissions on the shared directory ('' |
| <code bash> | <code bash> | ||
| - | sudo chown shareuser_example: | + | sudo chown shareuser_example: |
| - | sudo chmod -R 770 / | + | sudo chmod -R 770 / |
| </ | </ | ||
| ===== 4. Check Samba Configuration ===== | ===== 4. Check Samba Configuration ===== | ||
| - | After saving your changes to //< | + | After saving your changes to '' |
| <code bash> | <code bash> | ||
| testparm | testparm | ||
| Line 129: | Line 129: | ||
| ===== 5. Restart Samba Services ===== | ===== 5. Restart Samba Services ===== | ||
| - | To apply the new configuration, | + | To apply the new configuration, |
| <code bash> | <code bash> | ||
| sudo systemctl restart smbd | sudo systemctl restart smbd | ||
| Line 143: | Line 143: | ||
| ===== 6. Configure Firewall (if ufw is enabled) ===== | ===== 6. Configure Firewall (if ufw is enabled) ===== | ||
| - | If you are using //< | + | If you are using '' |
| <code bash> | <code bash> | ||
| sudo ufw allow Samba | sudo ufw allow Samba | ||
| Line 152: | Line 152: | ||
| sudo ufw allow proto udp from any to any port 137,138 | sudo ufw allow proto udp from any to any port 137,138 | ||
| </ | </ | ||
| - | Then, reload | + | Then, reload |
| <code bash> | <code bash> | ||
| sudo ufw reload | sudo ufw reload | ||
| Line 159: | Line 159: | ||
| ===== 7. Connect from Client Computers ===== | ===== 7. Connect from Client Computers ===== | ||
| - | You can now connect to your Samba share from various client operating systems. Replace | + | You can now connect to your Samba share from various client operating systems. Replace |
| ==== 7.1. Windows ==== | ==== 7.1. Windows ==== | ||
| - Open File Explorer. | - Open File Explorer. | ||
| - | - In the address bar, type: //< | + | - In the address bar, type: '' |
| - You should see your defined share(s). Double-click to open. | - You should see your defined share(s). Double-click to open. | ||
| - | - If connecting to a secure share, you will be prompted for the username and password you set with //< | + | - If connecting to a secure share, you will be prompted for the username and password you set with '' |
| - To make access easier, you can right-click the share and select "Map network drive..." | - To make access easier, you can right-click the share and select "Map network drive..." | ||
| Line 171: | Line 171: | ||
| - Open your file manager (e.g., Nautilus, Dolphin, Thunar). | - Open your file manager (e.g., Nautilus, Dolphin, Thunar). | ||
| - Look for an option like " | - Look for an option like " | ||
| - | - Enter the server address in the format: | + | - Enter the server address in the format: |
| - If prompted, enter the credentials for your secure share. | - If prompted, enter the credentials for your secure share. | ||
| Line 193: | Line 193: | ||
| sudo mount -t cifs // | sudo mount -t cifs // | ||
| </ | </ | ||
| - | (You will be prompted for the Samba password for //< | + | (You will be prompted for the Samba password for '' |
| - | - To automatically mount the share at boot, you can add an entry to your //< | + | - To automatically mount the share at boot, you can add an entry to your '' |
| ==== 7.4. macOS ==== | ==== 7.4. macOS ==== | ||
| - Open Finder. | - Open Finder. | ||
| - From the menu bar, click " | - From the menu bar, click " | ||
| - | - In the " | + | - In the " |
| - Click " | - Click " | ||
| - If prompted, enter the username and password for your secure share. | - If prompted, enter the username and password for your secure share. | ||
| Line 208: | Line 208: | ||
| * **NFS (Network File System):** Primarily used in Linux/Unix environments. It can be faster than Samba but setting it up for Windows clients is more involved. | * **NFS (Network File System):** Primarily used in Linux/Unix environments. It can be faster than Samba but setting it up for Windows clients is more involved. | ||
| - | * **SFTP (SSH File Transfer Protocol): | + | * **SFTP (SSH File Transfer Protocol): |
| ===== 9. Recommendation ===== | ===== 9. Recommendation ===== | ||
| For most users needing to share folders between a Linux server and various client operating systems including Windows, **Samba is the recommended solution** due to its wide compatibility and ease of use on client machines. Opt for user authentication (Example 2) for better security. | For most users needing to share folders between a Linux server and various client operating systems including Windows, **Samba is the recommended solution** due to its wide compatibility and ease of use on client machines. Opt for user authentication (Example 2) for better security. | ||
| + | |||
| + | |||
| + | ===== 10. Paperless NGX Connection ===== | ||
| + | |||
| + | You should add the following line. You can change the path's as you created before. | ||
| + | <code yml> | ||
| + | volumes: | ||
| + | - / | ||
| + | </ | ||
| + | |||
| + | |||
| + | User of SMB's UID should be equal to the USERMAP_UID and USERMAP_GID values. | ||
| + | <code yml> | ||
| + | environment: | ||
| + | USERMAP_UID: | ||
| + | USERMAP_GID: | ||
| + | </ | ||
| + | |||
