Configuring Samba in some minutes

Swobodin's picture
Submitted by Swobodin on Mon, 2006-05-29 08:19. ::
The following file is just an example of smb.conf, you may edit smb.conf according to your needs. This configuration only means to show how simple is to configure Samba for a common network.
smb.conf

Samba Configuration

# Global parameters

[global]

workgroup = SOUZAGAMA

server string = anderson

security = SHARE

password server = None

log file = /var/log/samba/%m.log

max log size = 50

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

printcap name = /etc/printcap

dns proxy = No

idmap uid = 16777216-33554431

idmap gid = 16777216-33554431

cups options = raw

[homes]

comment = Home Directories

writeable = yes

browseable = No

[printers]

comment = All Printers

path = /var/spool/samba

printable = Yes

browseable = No

[documentos]

comment = documentos

path = /var/samba/documentos

writeable = yes

guest ok = yes

vfs objects = extd_audit, recycle

[programas]

comment = programas

path = /var/samba/programas

writeable = yes

guest ok = Yes

vfs objects = extd_audit, recycle

[media$]

comment = media

path = /media

writeable = yes

guest ok = yes

max connections = 1

Sharing

This smb.conf is too much more "dry" than the one that you night find if you typed
mcedit /etc/smb.conf
for the fact that it has been created by swat, a powerful graphical tool to configure samba.
The objective of each network is to link computers and to share informations. My objective also was connecting my computer to another and to transfert files between each other. Without many restrictions, without access permission, only sharing with recycling resources (imagine that users delete the file xyz.txt that contains their CV's) nad system audit (knowing who does and when).

Configuring

Assuming that you are using Fedora Core 3, distribution easy of use and polyvalent, I retrieved apt from http://freshrpms.net, got into the shell (I prefer using apt from shell, for those who like GUI applicationsit's possible to get synaptic from http://pbone.net on your updated version) and typed the old and good
apt-get update
to update sources, then I did
apt-get install samba-swat
Once installed on system, you should activate swat using
ntsysv
choose it for being executed at boot start, and type
service xinetd start
Swat is now loaded by xinetd

Accessing

To be able to access to swat, point your browser to
http://127.0.0.1:901
A pop-up will be opened, type your root login and pasword. Click on "wizard", then "rewrite", you will notice that smb.conf has been considerably reducend.

smb.conf

Open in shell
mcedit /etc/samba/smb.conf
Now you can see how became smb.conf.
# Global parameters

[global]

workgroup = SOUZAGAMA #Your workgroup name

server string = anderson #your machine name on the network

security = SHARE #whether to share without authentication

password server = None

log file = /var/log/samba/%m.log # Samba log file

max log size = 50

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

printcap name = /etc/printcap

dns proxy = No

idmap uid = 16777216-33554431

idmap gid = 16777216-33554431

cups options = raw
[homes]
#Users particular directories for authentication

comment = Home Directories

writeable = yes #Whether the directoryis writable

browseable = No # Invisible

[printers]

comment = All Printers

path = /var/spool/samba # Spool directories for printers

printable = Yes

browseable = No #Invisible

[documentos]
# Sharing

comment = documentos

path = /var/samba/documentos # path to shared files

writeable = yes

guest ok = yes # Whether guests are accepted

vfs objects = extd_audit, recycle

[programas]
(compartilhamento)

comment = programas (comentário sobre o compartilhamento)

path = /var/samba/programas (caminho do compartilhamento)

writeable = yes (habilita a escrita)

guest ok = Yes (habilita acesso aos convidados=guest)

vfs objects = extd_audit, recycle

[media$] 
# As in Rwindows TM. The $ refers to sharing

comment = media # Do you remember /mnt? Now, everything is in /media

path = /media # Accessing CD-ROM, floppy and other devices

writeable = yes

guest ok = yes

max connections = 1 # Only one connection

Summary

This file is only an example of smb.conf that you may modify depeding on your preferences. To get access to the Samba recycle, you can just enter sharing. For example, if you want to hide the recycle directory, add a dot (.) before the directory name (/var/samba/documentos/.recycle)

Special thanks for the Fedora Brasil community.
Original article can be found (in Portuguese) at http://www.fedora.org.br/contentid-7.html or smash_se's blog