Installation and Configuration of Samba in 'User' Mode
Introduction
Samba is a free software licensed under the GPL that supports the SMB/CIFS protocol. This protocol is used by Microsoft for sharing various resources (files, printers, etc.) between computers running Windows. Samba allows Unix systems to access resources from these systems and vice versa.
Previously, PCs with DOS and early versions of Windows sometimes needed to install a TCP/IP stack and a set of Unix applications: an NFS client, FTP, telnet, lpr, etc. This was cumbersome and penalizing for PCs of that time, and it also forced users to adopt two sets of habits, adding those of UNIX to those of Windows. Samba therefore adopts the opposite approach.
Its name comes from the file and print sharing protocol from IBM and reused by Microsoft called SMB (Server message block), to which two vowels "a" were added: "SaMBa".
Samba was originally developed by Andrew Tridgell in 1991 and now receives contributions from about twenty developers from around the world under his coordination. He gave it this name by choosing a name close to SMB by querying a Unix dictionary with the command grep: grep "^s.*m.*b" /usr/dict/words
When both file sharing systems (NFS, Samba) are installed for comparison, Samba proves less efficient than NFS in terms of transfer rates.
Nevertheless, a study showed that Samba 3 was up to 2.5 times faster than Windows Server 2003's SMB implementation. See the information on LinuxFr.
However, Samba is not compatible with IPv6.
The "User" mode allows you to share folders simply by user. You then need a login and a password. This is a sufficiently secure solution for small businesses.
Installation
Debian
To install Samba:
FreeBSD
For FreeBSD:
Configuration
To configure Samba, edit the file /etc/samba/smb.conf
(/usr/local/etc/smb.conf
under FreeBSD):
Some explanations:
- First configure the data in Global
- Set the OS level < 20 unless it acts as a domain controller, then > 50
Adapt all this to your configuration. Then restart Samba:
Or like this under FreeBSD:
Now, you need to add users! It's quite simple, but it's the kind of thing you often forget:
This will add my user deimos. And here is the list of possible options:
Under FreeBSD, you can find the file containing the list of authorized users in /usr/local/etc/samba34
.
For FreeBSD still, if you want Samba to start automatically at boot:
Connection
Windows
To connect from Windows, in a link window, type this:
You will access the share directly.
Unix (Linux/Mac...)
You must have smbfs installed before continuing:
Then, simply create a folder and mount the share in it:
FAQ
Test your configuration
If you have some problems, here is a way to check your configuration (FreeBSD):
Unable to connect to CUPS server localhost:631 - Connection refused
If you don't use a CUPS print server, then make the following changes to disable it and allow Samba to start:
Migrate your smbpasswd file to tdbsam
It is possible that when updating your Samba, your smbpasswd file no longer works and must be replaced by a tdbsam. All your users will then no longer work. The easiest way is to convert all your old accounts to this new format:
You may need to modify your samba configuration file to add this:
Resources
-
If you want to push folder permissions, check the documentation on ACL: Implementation of NT-type rights.
- CIFS Solaris Workgroup
- http://www.csua.berkeley.edu/~ranga/notes/freebsd_samba.html+samba+freebsd&cd=6&hl=fr&ct=clnk&client=ubuntu
- http://www.tobanet.de/dokuwiki/samba:upgrade