Monday, March 26, 2012

Debain 6.0.4: quick samba installation and configuration

Here is a quick description to how to install samba server and configure it in order to share folder on the network.

Giving 
apt-cache search samba
results:
[...]
libsmbclient-dev - development files for libsmbclient
libsmbclient - shared library for communication with SMB/CIFS servers
libwbclient0 - Samba winbind client library
samba-common-bin - common files used by both the Samba server and client
samba-common - common files used by both the Samba server and client
samba-dbg - Samba debugging symbols
samba-doc-pdf - Samba documentation in PDF format
samba-doc - Samba documentation
samba-tools - Samba testing utilities
samba - SMB/CIFS file, print, and login server for Unix
smbclient - command-line SMB/CIFS clients for Unix
swat - Samba Web Administration Tool
winbind - Samba nameservice integration server
smb2www - SMB/CIFS network client with a web interface
[...]
So run
apt-get install samba smbfs smbclient
to install these three packets....
during installation, it performs default configuration
after....
So next commands.....
adduser guest --home=/home/public --shell=/bin/false --disabled-password
to create a guest user to use only as samba default user....
chmod -R 0700 /home/public
chown -R guest.guest /home/public
These commands configure the sharing in way of every user can create a content(file or folder)
into the shared folder.
No one may edit the content created by something others.... 
If you want some of differently, change the permission mask.....
Now edit /etc/samba/smb.conf
adding after the row 
obey pam restrictions = yes
insert these others rows: 
guest account = guest
invalid users = root

and in the ****Authorization**** section,  these two rows.....: 
; security = user
security = share

In the sharing section add:

# SHARED DIR
[shared]
   comment = shared
   read only = no
   path = /home/public
   guest ok = yes
   guest only = yes
   create mask = 0600
   directory mask = 0700

 
Fine...... restart samba:

 /etc/init.d/samba restart

and all is done.....

 Bye....

No comments:

Post a Comment