Monday, May 7, 2012

Ubuntu - Setup Group Share on Samba


The purpose of this procedure is to setup access to a FTP site using a SAMBA share. All users will access the same share.
This procedure has been tested against Ubuntu 10.04 LTS
There's a few steps that have been done before running this procedure. We've configured the FTP server in this procedure which has created the following:
  • A folder called /srv
  • A folder called /srv/ftp
  • A folder called /srv/ftp/shared
  • A linux group called ftpshared
  • The group ftpshared has been given root:ftpshared access to /srv/ftp/shared

First we start by installing the samba packages:

sudo apt-get install samba
sudo service smbd stop

Before we start modifying the Samba configuration we will backup the existing samba configs:

sudo mv /etc/samba/smb.conf /etc/samba.smb.conf.bak

Setup a new blank smb.conf file:

sudo nano /etc/samba/smb.conf

Now paste the following into the smb.conf file:
[global]
    ; General server settings
    netbios name = server_name
    server string =
    workgroup = WORKGROUP
    announce version = 5.0
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

    passdb backend = tdbsam
    security = user
    null passwords = true
    username map = /etc/samba/smbusers
    name resolve order = hosts wins bcast

    wins support = yes

    printing = CUPS
    printcap name = CUPS

    syslog = 1
    syslog only = yes

[ftp]
path=/srv/ftp/shared
valid users=@ftpshared
create mode=0600
directory mode=0775
browseable=yes
read only=no
force group=ftpshared

Save the file using Ctrl-O, Ctrl-X. Now restart the samba service:

sudo service smbd start

Assuming linux users already exist on the system they only need to be added to the ftpshared group and given a Samba password to access the fileshare:

sudo smbpasswd -L -a [user_name]




No comments:

Post a Comment