Simple setup using Samba server to share files with Windows clients

Hello :smiley:

I am writing this post to show how to setup a simple File server to share files with Windows PC.
this is the first Arch based distro which i am using for more than 2 weeks.
until i almost gave up trying to configure Samba and decided to go back to ubuntu/opensuse as the help docs are very simple whereas Arch Wiki has a complex info on Samba config.
which will scare a intermediate level Home user.

so, this is what worked for me and am still staying with EndeavourOS! :heart_eyes:

Installation

sudo pacman -S samba gvfs-smb --needed

Configuration

as quoted in Arch Wiki " Because the samba package does not provide this file, one needs to create it before starting smb .service."
so lets create smb.conf file

sudo leafpad /etc/samba/smb.conf

my smb.conf file looks as below, simple but gets the work done.

[global]
workgroup = WORKGROUP
security = user

[mj]
comment = EndeavourOS-server
    path = /home/mj
    browsable = yes
    read only = no
    create mask = 0755
    valid users = @mj

the workgroup specified in the [global] section has to match the Windows workgroup (default WORKGROUP ) , i have not changed the windows workgroup hence its stays as default.

next i need my Home partition on EnOS to be accessible from Windows.

  • [mj] - is my home folder name which i wish to use as shared-folder
  • Comment - short description.
  • path - path of the folder to be shared. i.e mj
  • browsable - enter yes if you want to browse directories using windows explorer from windows.
  • read only - if value is β€˜yes’ then share is read only, if value is β€˜no’ then its writable.
  • create mask - set file permissions, i used Owner will rwx, group and others will only rx.
  • valid users - Users/groups who can connect to a share

next, create a group sambashare and add user to group.
sudo groupadd -r sambashare
sudo gpasswd -a mj sambashare

Now configure firewall.
open UFW and allow samba service. click add rules and search for smb and you should have ports and configs readily available.

now start smb service.
sudo systemctl enable smb nmb
sudo systemctl start smb nmb
if any issue restart the services.

now from windows you should be able to browse the home folder on linux.
you can access the server from windows by \\ip address\shared-folder

below are few screens on how to add the shared directory to Windows explorer.





enter user name and password when prompted.
5

finally i am able to access my home folder on Enos from windows and other PC’s
:star_struck: :star_struck: :star_struck: :star_struck: :star_struck:

3 Likes