15
Oct

Samba Configuration

   Posted by: Vlad   in Linux

Samba provides file and print services for various Microsoft Windows clients and runs on most Unix and Unix-like systems, such as Linux, Solaris, AIX and the BSD variants, including Apple’s Mac OS X Server.

Samba is an implementation of dozens of services and a dozen protocols, including NetBIOS over TCP/IP (NBT), SMB, CIFS (an enhanced version of SMB), DCE/RPC or more specifically, MSRPC, the Network Neighborhood suite of protocols, a WINS server also known as a NetBIOS Name Server (NBNS), the NT Domain suite of protocols which includes NT Domain Logons, Secure Accounts Manager (SAM) database, Local Security Authority (LSA) service, NT-style printing service (SPOOLSS), NTLM and more recently Active Directory Logon which involves a modified version of Kerberos and a modified version of LDAP. All these services and protocols are frequently incorrectly referred to as just NetBIOS or SMB. Samba can also see and share printers.

The simplest way to find out if you have samba installed on your unix system is with the following command:

smbd -V

You will see something like:

Version 3.0.25b

The configuration file resides in /etc/samba and is named smb.conf. This file can contain only one line and still work:

[homes]

For more control you can start configuring the global options:

[global] 
workgroup = Network
server string = IT Manager’s Samba
netbios name = Server
encrypt passwords = yes
log file = /var/log/samba/log.%m
security = user

These are the global options in which we set the name of the network and of the computer and also that we want the passwords encrypted. For file sharing we need to add the following lines:

[homes]
read only = no
browseable = no

This configuration will give each user on the system access to his own /home directory.

To create a folder in which all users ould have read/write permissions we first create it

mkdir /public

then add the next lines in smb.conf:

[public]
path = /public
read only = no
browseable = yes

I forgot to mention that after each change in the configuration file you must reload the samba server:

# service smb restart

Shutting down SMB services:                                [  OK  ]
Shutting down NMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]

For adding users to the samba server type this in the console:

# useradd -d /home/smbadmin -s /sbin/nologin -n smbadmin
# passwd smbadmin
Changing password for user smbadmin.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
# smbpasswd -a smbadmin
New SMB password:
Retype new SMB password:
Added user smbadmin.
#

This is it.


Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

This entry was posted on Wednesday, October 15th, 2008 at 11:59 am and is filed under Linux. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment