The SAMBA server configuration file smb.conf
is usually in /etc/samba/.
This is the main configuration file. It is read by both the smbd and nmbd daemons.
This file is used to alias UNIX and SMB names. Here is a sample:
cat /etc/samba/smbusers # Unix_name = SMB_name1 SMB_name2 ... root = administrator admin nobody = guest pcguest smbguest
![]() | Note |
|---|---|
Not all users need to be listed in |
This file contains the list of SMB users. The passwords are used to connect to services that require login.
cat /etc/samba/smbpasswd tux:660:1D0B273898 ...[snip]... 65A6:[U ]:LCT-434B951B: gnu:670:3BSL639205 ...[snip]... 34E2:[U ]:LCT-434B56C1:
![]() | Note |
|---|---|
The user |
The LanManager hosts file. This file is usually in the same directory as the
smb.conf file and is read by nmbd
to resolve netBIOS hostnames. The file content is similar to
/etc/hosts:
10.0.0.20 accounts
The SAMBA server uses two daemons called nmbd and smbd implementing NMB and SMB services respectively. Both daemons are started with the single rc-script:
/etc/rc.d/init.d/smb start
smb.conf configuration file is devided into sections. Each section (apart from [global] and [printers]) is the name of a share as it will appear on a listing.
Example listing:
smbclient -L //server Sharename Type Comment IPC$ IPC Remote IPC Training Disk Example disk share laserprinter Printer Shared printer NETLOGON Disk Logon server shareSome sections such as
[global], [home] and
[printers] have a special meaning.
The following parameters can be set in the [global] section:
STRING STRING PATH /etc/printcapUNIX ACCOUNT guest which is mapped to nobody. This option can be used to set an alternative username as the guest account yes/no PATH smbusers file. This file is used to associate UNIX account names with one or more NT namesn yes/no yes if the server has to act as a logon server. In this section it is possible to share the printers defined with either CUPS or LPR. See Section 5.3.2, “Sharing Printers” for a sample configuration.
All options in smb.conf are of the form
parameter = option
yes/noguest useryes/noyes/noyes/noyes/noguest logins for the service. This option has an effect only if used with the guest ok option