If you have multiple computers in your small office and want to share files between them, setting up a Samba share on your Linux Mint Debian Edition (LMDE) system can be a great solution. Samba is an open-source implementation of the SMB/CIFS networking protocol that enables file and printer sharing between different operating systems, including Windows, Linux, and macOS.
In this tutorial, we’ll go through the steps of installing and configuring Samba on LMDE, creating a shared directory, setting up a Samba user with access to the shared directory, and finally connecting to the Samba share from a Windows 10 machine.
Installing Samba on LMDE
To install Samba on LMDE, open a terminal and run the following command:
sudo apt-get install samba
This will download and install the Samba package and its dependencies.
Configuring Samba on LMDE
Once Samba is installed, we need to configure it by editing the smb.conf
file. This file is located in the /etc/samba/
directory.
Open the smb.conf
file in a text editor with root privileges:
sudo nano /etc/samba/smb.conf
Add the following lines at the end of the [global]
section:
workgroup = WORKGROUP
map to guest = never
security = user
These settings configure Samba to use the same workgroup name as the Windows computers on your network, disable guest access to the Samba share, and require users to authenticate with a Samba user account.
Save and close the smb.conf
file by pressing Ctrl+X
, then Y
, then Enter
.
Creating a Shared Directory
Next, we need to create a directory that will be shared with other computers on the network. You can choose any directory that you want, but for this tutorial, we’ll use /home/myuser/share
.
Create the directory with the following command:
sudo mkdir /home/myuser/share
Setting Permissions on the Shared Directory
Before we can share the directory with Samba, we need to set the appropriate permissions on it.
Change the ownership of the directory to the myuser
Samba user and the sambashare
group:
sudo chown myuser:sambashare /home/myuser/share
Set the permissions on the directory to allow the myuser
Samba user and the sambashare
group to read, write, and execute files:
sudo chmod 770 /home/myuser/share
Creating a Samba User
Now we need to create a Samba user account that will be used to authenticate access to the shared directory.
Create the Samba user with the following command:
sudo smbpasswd -a myuser
This will prompt you to enter a password for the Samba user. Choose a strong password and remember it, as you’ll need it later to connect to the Samba share from other computers.
Restarting the Samba Service
To apply the changes we’ve made to the Samba configuration, we need to restart the Samba service.
Restart the Samba service with the following command:
sudo systemctl restart smbd
Connecting to the Samba Share from Windows 10
Now that you have set up the Samba server and created a shared folder, you can connect to it from a Windows 10 machine. Here’s how:
- Open File Explorer on your Windows 10 machine.
- In the address bar, enter
\\<ip-address-of-your-samba-server>
and press Enter. - If prompted, enter the username and password of the Samba user you created earlier.
- You should now see the shared folder that you created on the Samba server. You can access it just like any other folder on your Windows 10 machine.
If you want to automatically map a drive to the Samba share on system startup, you can do so by following these steps:
- Open File Explorer on your Windows 10 machine.
- Click on the “Map network drive” button in the toolbar.
- In the “Drive” field, select a drive letter to use for the mapped drive.
- In the “Folder” field, enter
\\<ip-address-of-your-samba-server>\<name-of-shared-folder>
. - Check the box next to “Connect using different credentials”.
- Click on the “Finish” button.
- When prompted, enter the username and password of the Samba user you created earlier.
- Check the box next to “Reconnect at sign-in” if you want the mapped drive to be automatically reconnected on system startup.
Conclusion
In this post, we went over the steps required to set up a Samba server on LMDE and create a shared folder that can be accessed from a Windows 10 machine. We also covered how to create a Samba user, set permissions, and automatically map a drive to the Samba share on system startup. By following these steps, you should be able to create a secure and reliable file sharing solution for your network.
Leave a Reply