Project

General

Profile

Wiki » History » Version 1

Gareth Eaton, 03/10/2023 07:45 AM

1 1 Gareth Eaton
h1. Share a Linux Mint folder
2
3
* Install Samba.
4
* Check the Samba server status.
5
* Allow Samba across the firewall.
6
* Add user to Sambashare group.
7
* Set SambaShare password.
8
* Click sharing option.
9
* Turn on the share folder toggle.
10
11
h2. Step 1:  Perform a system update.
12
13
<pre>
14
sudo apt update
15
</pre>
16
17
h2. Step 2: Samba installation in Linux Mint
18
19
<pre>
20
sudo apt install samba
21
</pre>
22
23
Once it has been installed, run the command below to ascertain that the service is up and running:
24
25
<pre>
26
sudo systemctl status smbd
27
</pre>
28
29
If the service is not active, execute the following line of code:
30
<pre>
31
sudo systemctl --enable now smbd
32
</pre>
33
34
h2. Step 3: Allow Samba across the Linux Mint Firewall
35
36
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.
37
<pre>
38
sudo ufw allow samba
39
</pre>
40
41
h2. Step 4: Include your user in the Samba group.
42
43
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:
44
<pre>
45
sudo usermod -aG sambashare $USER
46
</pre>
47
48
Next, set the share password: This should be distinct from your system password.
49
50
<pre>
51
sudo smbpasswd -a $USER
52
</pre>
53
54
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.
55
<pre>
56
sudo usermod -aG sambashare your-user
57
</pre>
58
59
To set a password, execute the following line of code:
60
<pre>
61
sudo smbpasswd -a your-user
62
</pre>
63
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:
64
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.
65
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.