Samba Server

Samba is very easy to install. However it requires a fully installed LDAP Server from previous chapter:

aptitude install samba

Create a global exchange folder:

mkdir /media/4all

Edit /etc/samba/smb.conf

[global]

workgroup = x2gogroup
server string = %h server (Samba %v)
netbios name = x2goserver
passdb backend = ldapsam:ldap://x2goserver
ldap admin dn = cn=ldapadmin,o=linux4afrika,c=tz
ldap group suffix = ou=group
ldap idmap suffix = ou=idmap
ldap machine suffix = ou=machines
ldap passwd sync = Yes
ldap suffix = o=linux4afrika,c=tz
ldap ssl = no
ldap user suffix = ou=people
idmap uid = 1500-2000
idmap gid = 1500-2000

domain logons = Yes
os level = 64
preferred master = Yes
domain master = Yes


logon home = \\%L\%U\.xprofile

add user script = /usr/sbin/smbldap-useradd -m '%m'
delete user script = /usr/sbin/smbldap-userdel '%u'
add group script = /usr/sbin/smbldap-groupadd -p '%g'
delete group script = /usr/sbin/smbldap-groupdel '%g'
add user to group script = /usr/sbin/smbldap-groupmod -m '%u' '%g'
delete user from group script = /usr/sbin/smbldap-groupmod -x '%u' '%g'
set primary group script = /usr/sbin/smbldap-usermod -g '%g' '%u'
add machine script = /usr/sbin/smbldap-useradd -w '%u'

[homes]

comment = Home Directories
valid users = %S
read only = No
browseable = No
hide dot files = Yes



[netlogon]
comment = Network Logon Service
path = /etc/samba/netlogon
admin users = root, teacher
guest ok = Yes
browseable = No

[Profiles]
comment = Roaming Profile Share
path = /home/samba/profiles
read only = No
profile acls = Yes

[share]
comment = SHARE
path = /home/shared
admin users = admin,teacher
read only = No

[4all]
path = /media/4all
public = yes
read only = no
browseable = yes
force user = nobody
create mask = 777
directory mask = 777

Restart your samba daemon:

/etc/init.d/samba restart

To test your new server you may open Konqueror and type:

smb://192.168.0.250 (Test environment was 192.168.0.5!)

You will notice that you have full read/write access to the 4all share.