Loading...

Setup file-server for Windows

:heavy_exclamation_mark: This post is older than a year. Consider some information might not be accurate anymore. :heavy_exclamation_mark:

We enable the Raspberry Pi as file server for Windows. To achieve that we need to install Samba. Samba allows windows clients to access the Raspberry Pis attached storage devices. All commands need root privileges, if you are working as user gain privileges by adding sudo before each command.

Install samba software

apt-get install samba samba-common-bin

The samba configuration can be found in /etc/samba/smb.conf.

This configuration should contain

workgroup = WORKGROUP
wins support = yes

At the bottom of the configuration file you add to your network share for Windows. Following example is a the share named Backup from which the Windows client can read and write.

[Backup]
comment = Backup Folder
path = /media/usbhdd/share
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no
writeable = yes
browseable = yes

Some explanations

  • path points to physical directory, the external usb hdd
  • authenticated samba user must be in group users
  • file permissions are in create and directory mask
  • since it is a backup folder, writable is yes

As you have noticed, the Windows client has to authenticate to access the network share. The samba user is also the linux user. If the smb.conf has a password sync, it will also change the password of the user on the linux OS. To allow Windows to authenticate as user john, john has to be in group users. I assume the group users already exists.

Add the user john to group users

usermod -a -G users john

Set samba password for user john

smbpasswd -a john

Start samba

service samba start

After that you should be able to access the network share.

Please remember the terms for blog comments.