How to Edit smb.conf in Linux Mint


Linux Mint provides incredible features to its users. It has built-in packages to share files. Samba is also one of the packages that enable the sharing of files and printers across different operating systems. With the help of Samba, one can share data between Linux-based distributions and Windows operating systems. Samba is available for free and open source that is widely used for network sharing.

This learning-based guide will capacitate you on how to edit smb.conf, particularly Linux Mint.

How to Edit “smb.conf” in Linux Mint?

Follow the provided steps for installing and editing the smb.conf in Linux Mint.

Step 1: Install the Samba Package in Linux

The below mentioned single line code will install the Samba package along with its libraries in your operating system, such as Linux Mint:

sudo apt-get install samba -y


In the above snapshot, it can be seen that the Samba package has been installed successfully.

Step 2: Check the Status of Samba Service

To check the status of Samba services in your Linux Mint, here is the command for you. Run the below-written command to check the status of the Samba service:

sudo service smbd status


According to the above output, the Samba service in Linux Mint is Active and ready to use.

Step 3: Create a Private Directory

After installing and activating the smbd service, we will now create a separate directory in the drive to share data. For example, we have created a private folder “sambashare” in home/genie using the following command:

mkdir /home/genie/sambashare/

Step 4: Open the smb.conf File

Before editing the smb.conf file, you need to locate the smb.conf file and copy the absolute path. Open a text editor of your choice to edit or run the following command to open the smb.conf file in the built-in nano text editor:

sudo nano /etc/samba/smb.conf

Step 5: Edit the smb.conf File

When the smb.conf file is opened in the nano editor, scroll to the end of the file and copy the given-below code. Press Ctrl+O to save the configuration file and exit with Ctrl+X:

[sambashare]

comment = Samba on Genie

path = /home/genie/sambashare

read only = no

browsable = yes

Step 6: Restart smbd Service

Run the below-mentioned command to restart the smbd service and to save the changes:

sudo service smbd restart

Step 7: Access the Shared Folder

Once you have completed the installation and configuration process of smb.conf, now you can access the folder you have created earlier. The following screenshot is for a better understanding of the concept:

It can be seen in the above snapshot that in the Network directory, the sambashare folder is available to use.

Conclusion

In Linux Mint, the smb.conf file can be edited. The “sudo apt-get install samba” command is used to install the samba package. Whereas, the “sudo nano /etc/samba/smb.conf” command is used to edit the file according to your need and requirements. With the help of this write-up, we have guided you to edit the smb.conf file in Linux Mint.

Print Friendly, PDF & Email
Categories