How to: Public samba shares in Manjaro

Since I discovered Manjaro 2 months ago, I found my new preferred desktop Linux distribution.

Being from a non-tech savvy country, and owning a non-tech company, I mainly need a user-friendly, fast and stable Linux that I can install on my company’s computers for the employees to use. Manjaro was pretty much ready to use with the default setup, and the only thing I needed to add was a GUI for creating samba shares.

And, here are the steps to accomplish that.

Assumptions:

  • you have a running XFCE Manjaro install, with Thunar File Manager
  • you are an admin (sudo rights)

Install thunar-shares-plugin-manjaro

  1. Open a new terminal window and type
    sudo pacman -S thunar-shares-plugin-manjaro

Edit smb.conf to set default guest user and group

In the default install, every file and directory created by guests will have root as owner and group. This will prevent the actual computer user from editing/deleting the files created by a samba user. We set the “guest account” mapping to “nobody” and force every file created via samba to belong to the sambashare group and be editable by it.

  1. In a terminal prompt (window) type:
    sudo mousepad /etc/samba/smb.conf
    Mousepad is a graphical editor in Manjaro, but use any editor you like: nano, vi ...
  2. Change guest account setting to nobody:
       guest account = nobody
  3. Add the following lines to the end of your file:
       group = sambashare
       force create mode = 0070
       force directory mode = 0070
  4. My smb.conf file looks like this, yours should be similar.
    [global]
       workgroup = MANJARO
       server string = Samba Server
       log file = /var/log/samba/%m.log
       max log size = 50
       security = user
       map to guest = Bad User
       guest account = nobody
       usershare path = /var/lib/samba/usershare
       usershare max shares = 100
       usershare allow guests = yes
       usershare owner only = yes
       group = sambashare
       force create mode = 0070
       force directory mode = 0070
    

Grant executable right to your home directory

This is necessary so that other users can access your shares. There doesn't seem to be any security implications, but please feel free to let me know otherwise.

  1. In a terminal prompt (window) type:
    chmod o+x /home/<username>
    Replacing <username> with your username

Restart your computer

Done, now your computer is setup to share folders via samba with guest users. All that is left to do, is create your shares.

Setup your shares

  1. Open your File Manager (Thunar)
  2. Go to the folder you want to share
  3. Right click on it, open Properties and go to the Share tab
    Thunar file manager directory contextual menu
  4. Enable sharing and apply settings.
    Thunar file manager directory Share tab
  5. Done. You can now connect from other computers on your network.
March 1, 2017

Comments