|
|
Linux Samba Howto
The below configuration has been tested with Windows 2000/XP as a client.
Modify the parameters to suit your network environment.
- cp -p /etc/smb.conf /etc/smb.conf.orig
-
Create the users that should be authenticated the Linux server running Samba.
Use the adduser command, useradd or userconf, you can also use some tool for users administration, but with graphic user interfase (Webmin, Linuxconf, Yast, etc.).
Be sure that users have access only to Linux/Samba services (if you want it), it implies they don't have access to the Linux shell, to do it they will have /dev/null as home directory and /bin/false as shell.
Convert the UNIX users to Linux/Samba/Windows users, creating the smbpasswd file.
cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd
Another way to do it, execute the following Samba commands for users creation and for passwords definition:
smbadduser
smbpasswd
These commands work in a similar way to adduser and passwd commands.
- Edit the Samba configuration file (smb.conf), making sure to include or to remove the comment signs for the options that are shown below:
vi /etc/smb.conf
- workgroup = WORKGROUP
- netbios name = SMBServer
- hosts allow = 192.168.2
- encrypt passwords = yes
- smb passwd file = /etc/smbpasswd
- interfaces = 192.168.2.1/24
- local master = no
- os level = 0
- domain master = yes
- preferred master = false
NOTE: When using Windows XP/2k with Samba be sure to set the following parameters as there are issues getting the above Windows environments to work.
- preferred_master = false
- local_mater = no
- os level = 0
- Create the shared resources:
[tmp]
comment = Temporary file system
path = /tmp
read only = no
public = yes
[homes]
comment = Home Directories
browseable = yes
writable = yes
- You can test the smb.conf correctness by using this command:
testparm
- Start/Restart the Samba daemon (smbd)
/etc/rc.d/init.d/smb restart
- Sample configuration file.
#==================== Global Settings ==========================
[global]
# workgroup = NT-Domain-Name or Workgroup-Name
workgroup = WORKGROUP
# Netbios name
netbios name = SMBServer
# server string is the equivalent of the NT Description field
server string = Samba Server
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
hosts allow = 192.168.2.
# this tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/%m.log
# Put a capping on the size of the log files (in Kb).
max log size = 0
# Security mode. Most people will want user level security. See
# security_level.txt for details.
security = user
# You may wish to use password encryption. Please read
# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
encrypt passwords = yes
smb passwd file = /etc/smbpasswd
# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
interfaces = 192.168.2.1/24
# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
local master = no
# OS Level determines the precedence of this server in master
# browser elections. The default value should be reasonable
os level = 0
# Domain Master specifies Samba to be the Domain Master Browser.
# This allows Samba to collate browse lists between subnets. Don't
# use this if you already have a Windows NT domain controller doing
# this job
domain master = yes
# Preferred Master causes Samba to force a local browser election on
# startup and gives it a slightly higher chance of winning the
# election
preferred master = false
# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's
# WINS Server
wins support = yes
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS
# names via DNS nslookups. The built-in default for versions 1.9.17
# is yes, this has been changed in version 1.9.18 to no.
dns proxy = no
#==================== Share Definitions =====================
[homes]
comment = Home Directories
browseable = yes
writable = yes
# This one is useful for people to share files
[tmp]
comment = Temporary file space
path = /tmp
read only = no
public = yes
|
|
|