[HOWTO] Fixing Samba sharing in LMDE

With all the goodness in Linux Mint Debian Edition (LMDE) there are some problems, like the fact that sharing files and folders with Samba doesn’t work. Had I checked the Linux Mint Forums sooner I would have seen the fix for the problem in the Tutorials section, and since I’ve finally found it I wanted to share it here to help everyone else find it. The tutorial is written with GNOME’s Nautilus file manager in mind but it works just as well for KDE users like myself. I’m going to give both the GNOME and KDE versions of the first step but the rest of the steps work beautifully regardless which desktop environment you prefer. Please note that if you use Xfce as your DE I have no idea if the steps need to be changed to work with it.

1. Enable “Guest Access” in Samba
For some reason this is disabled by default in LMDE but it’s an easy fix for it. Open the Samba configuration file as root in your preferred text editor. If you use GNOME run this command in your terminal

gksu gedit /etc/samba/smb.conf

If you’re a KDE user like me run this command in either your terminal or in the Run Command Interface

kdesudo kate /etc/samba/smb.conf

Once the file is open in your text editor add these two lines to the [global] section

usershare allow guests = yes
map to guest = Bad user

It doesn’t matter where within [global] you put those two lines. I put them at the bottom of the Misc. section (line 231) but you can put them right below the [global] section header around line 34. Once you have put the lines into the file save it and close it, then restart Samba by running this command in your terminal

sudo service samba restart

2. Add yourself to the correct usergroup
As things stand you won’t be able to create shared files and folders because you don’t have the right permissions. This is an easy fix by running this command in your terminal

sudo gpasswd -a your_user_name sambashare

Replace your_user_name with the name you use when logging into LMDE. Keep the terminal open because you’re not finished with it.

3. Install samba client packages
There are four packages you will need to install  on your system before you can set Samba to share files on your system. Run each line one line at a time in your terminal

sudo apt-get install gvfs-fuse
sudo apt-get install libsmbclient
sudo apt-get install smbclient
sudo apt-get install python-smbc

Now add yourself to the fuse group to make sure you have the permissions needed for actually using these packages

sudo gpasswd -a your_user_name fuse

again replacing your_user_name with your user name on the system.

4. Log out and back in for the group changes to take effect
That’s right, it’s that simple. If you’re running GNOME you may find that the “Create Share” button in Nautilus abruptly closes and your desktop will disappear but there’s no need to fear because it will return. There’s probably a bug filed with Debian about it but I haven’t seen it or a workaround for it yet. If you’re running KDE you don’t need to even worry about it because I didn’t see the glitch on my laptop.

Thanks to Linux Mint Forums user altair4 for writing the tutorial I found. You can find it, and other posts on the matter in the thread How To – Simple File Sharing in Mint on the Mint Forums.

Advertisement

2 Responses to “[HOWTO] Fixing Samba sharing in LMDE”

  1. Michael Says:

    Thanks! Outstanding. Easy to read+follow.

    However, I found out that there’s one thing missing if you (like I am) is running a network with IP-adresses that are different from 192.168.0.xxx.
    For example, the computers on my local network are using IP-adresses in the range 192.168.1.xxx (there’s a difference compared to 192.168.0.xxx).

    To enable a different range of ip-adresses, the “hosts allow”, “interfaces”, “remote announce” and “remote browse sync” (all of them, I think..?) should be changed when editing smb.conf (step 1 in the guide above).
    Again, if using IP-adresses in the range 192.168.1.1-255, the four entries mentioned above should be changed accordingly in smb.conf:
    hosts allow = 192.168.1.
    interfaces = 192.168.1.0/24
    remote announce = 192.168.1.255
    remote browse sync = 192.168.1.255
    …save smb.conf and follow the rest of the guide above, and everything should be OK (again: provided your computers have IP-adresses that a different from 192.168.0.xxx).
    At least it worked for me :)

    Thanks again for your guide.

    //Michael.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.