Project

General

Profile

Wiki » History » Version 2

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

1 1 Gareth Eaton
h1. Share a Linux Mint folder
2
3 2 Gareth Eaton
also See - [[ Setting up the smb.conf file]]
4
5 1 Gareth Eaton
* Install Samba.
6
* Check the Samba server status.
7
* Allow Samba across the firewall.
8
* Add user to Sambashare group.
9
* Set SambaShare password.
10
* Click sharing option.
11
* Turn on the share folder toggle.
12
13
h2. Step 1:  Perform a system update.
14
15
<pre>
16
sudo apt update
17
</pre>
18
19
h2. Step 2: Samba installation in Linux Mint
20
21
<pre>
22
sudo apt install samba
23
</pre>
24
25
Once it has been installed, run the command below to ascertain that the service is up and running:
26
27
<pre>
28
sudo systemctl status smbd
29
</pre>
30
31
If the service is not active, execute the following line of code:
32
<pre>
33
sudo systemctl --enable now smbd
34
</pre>
35
36
h2. Step 3: Allow Samba across the Linux Mint Firewall
37
38
To connect to and access shared files using SMB protocol, we must whitelist and enable access to its service from outside the machine. As a result, we will allow it in the firewall.
39
<pre>
40
sudo ufw allow samba
41
</pre>
42
43
h2. Step 4: Include your user in the Samba group.
44
45
Allow the current System user to access all files and folders shared under it by adding it to the SambaShare group. To do so, execute the following line of code:
46
<pre>
47
sudo usermod -aG sambashare $USER
48
</pre>
49
50
Next, set the share password: This should be distinct from your system password.
51
52
<pre>
53
sudo smbpasswd -a $USER
54
</pre>
55
56
Note that $USER refers to your current user; if you wish to set a different user, replace $USER with the user’s name. Furthermore, the file or folder you want to share must be available to that specific user.
57
<pre>
58
sudo usermod -aG sambashare your-user
59
</pre>
60
61
To set a password, execute the following line of code:
62
<pre>
63
sudo smbpasswd -a your-user
64
</pre>
65
That’s it. SMB (Samba) has been installed and configured correctly on our Linux Mint OS. To test it out, we shall try the following:
66
Assuming I want to share the “Shared” folder or any other folder on my Linux Mint that my current user owns. Navigate to that folder, right-click it, and pick the “Sharing options” tab.
67
Note: Occasionally, you might realize that the “Share this folder” option has been toggled off. To enable sharing, toggle on that option and check the “Allow others to create and delete files in this folder”. Once you are done, input the shared folder name and comment if need be and click the “Create share” button.