Setting up a Samba server: Difference between revisions

From Alpine Linux
(remove `samba-common-tools` from Installation because package `samba` including `samba-common-tools`)
Line 13: Line 13:
<nowiki>
<nowiki>
  [global]
  [global]
    workgroup = WORKGROUP
  allow insecure wide links = yes #to allow symlinks from everywhere
    dos charset = cp850
  workgroup = WORKGROUP
    unix charset = ISO-8859-1
  dos charset = cp850
    force user = username
  unix charset = ISO-8859-1
  force user = username
   
   
  [storage]
  [storage]
    browseable = yes
  follow symlinks = yes  # to follow symlinks
    writeable = yes
  wide links = yes      # to allow symlinks from outside
    path = /media/storage
  browseable = yes
  writeable = yes
  path = /media/storage
</nowiki>
</nowiki>
}}
}}

Revision as of 12:51, 9 February 2022

Installation

Install packages:

# apk add samba

Create a share directory

This will be the directory that's shared to clients. You can create as many of these as you wish.

# mkdir /media/storage

# chmod 0777 /media/storage

Create smb.conf

Alpine provides an example configuration file located at /etc/samba/smb.conf. The following is a simple example to get you up and running.

Contents of /etc/samba/smb.conf

# /etc/samba/smb.conf [global] allow insecure wide links = yes #to allow symlinks from everywhere workgroup = WORKGROUP dos charset = cp850 unix charset = ISO-8859-1 force user = username [storage] follow symlinks = yes # to follow symlinks wide links = yes # to allow symlinks from outside browseable = yes writeable = yes path = /media/storage
Note: For each directory share, you'll need to add a subsection to smb.conf

Create a system user and Samba user

Create a user on the system. Create a Samba user. Give both users the same password.

# adduser username

# smbpasswd -a username

Configure the Samba service

Run these two commands to start the service on boot and to start the service right now.

# rc-update add samba

# rc-service samba start