Wiki » History » Revision 6
Revision 5 (Gareth Eaton, 12/18/2023 01:50 AM) → Revision 6/7 (Gareth Eaton, 12/18/2023 01:52 AM)
h1. Share a Linux Mint folder [[My file setup]] also See - [[ Setting up the smb.conf file]] also See - [[How to Fix "Weak Crypto is Allowed" in Samba]] * Install Samba. * Check the Samba server status. * Allow Samba across the firewall. * Add user to Sambashare group. * Set SambaShare password. * Click sharing option. * Turn on the share folder toggle. h2. Step 1: Perform a system update. <pre> sudo apt update </pre> h2. Step 2: Samba installation in Linux Mint <pre> sudo apt install samba </pre> Once it has been installed, run the command below to ascertain that the service is up and running: <pre> sudo systemctl status smbd </pre> If the service is not active, execute the following line of code: <pre> sudo systemctl --enable now smbd </pre> h2. Step 3: Allow Samba across the Linux Mint Firewall 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. <pre> sudo ufw allow samba </pre> h2. Step 4: Include your user in the Samba group. 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: <pre> sudo usermod -aG sambashare $USER </pre> Next, set the share password: This should be distinct from your system password. <pre> sudo smbpasswd -a $USER </pre> 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. <pre> sudo usermod -aG sambashare your-user </pre> To set a password, execute the following line of code: <pre> sudo smbpasswd -a your-user </pre> 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: 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. 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. Show Users <pre> sudo pdbedit -L </pre> remove a user <pre> sudo pdbedit -x -u username or sudo smbpasswd -x username </pre> To remove the root user from your Samba user database, <pre> sudo pdbedit -x -u root </pre>