How to configure Samba Server in Ubuntu?

How to configure Samba Server in Ubuntu?

Table of Contents

  • What is Samba?
  • Target
  • Prepare
  • configure /etc/samba/smb.conf

1 What is Samba?

Samba is a linux implementation of file share and transaction protocol for LAN, which mainly used in Windows OS. Samba is more convenient than FTP in my opinion, and it is useful in a small group who works in a same LAN, but its members are familiar with different OS, Bob works in Mac, David works in Ubuntu, while Mars likes Windows more.

2 Target

This tutorial is a step to step document of how to build a Samba Server which met the following requirement:
  1. Share a Directory with both readable and writable authority for Guest.
  2. Share a Directory with both readable and writable authority for certain Users.
  3. Share a Directory with only readable authority for Guest.

3 Prepare

addgroup smbgrp
adduser abc smbgrp
smbpasswd -a abc

mkdir /xxx/path
chown -R abc:smbgrp /xxx/path

mkdir /xxx/public
chown -R nobody:nogroup /xxx/public

4 configure /etc/samba/smb.conf

# writable for user:smbgrp 
[private]
  comment = what ever you wanna say
  path = /xxx/path
  valid users = @smbgrp
  browsable = yes
  guest ok = no
  read only = no
  create mask = 0755

# only readable for guest
[share]
  comment = what ever you wanna say
  path = /xxx/path
  browsable = yes
  guest ok = yes
  read only = yes

# writable for guest, dir permission = nobody:nogroup
[public]
  comment = what ever you wanna say
  path = /xxx/public
  browsable = yes
  guest ok = yes
  read only = no
  create mask = 0755

Restart the Samba server after that.

Comments

Popular posts from this blog

Bluedroid stack in android

How to setup a NAT server?

Network programming in elisp