Samba Server Configuration in Linux

Configuring Samba Server


To install Samba run command

yum install samba samba-client samba-common

The Samba Configuration file is /etc/samba/smb.conf

Take a backup of this file before configuring any samba share using command
mv /etc/samba/smb.conf /etc/samba/smb.conf.bkp


Minimal smb.conf


Here is an example of a minimum configuration of smb.conf

$ cat /etc/samba/smb.conf
[global]
workgroup = WORKGROUP
[firstshare]
path = /srv/samba/public

Using this configuration you can start samba and it can be viewed to other computers.

To view on Microsoft go in My Network Places.

It should be noted that to view Samba on Windows machine, it must be on same workgroup.

To check the value in windows machine run the command at cmd prompt
net config workstation

Windows machine should be in WORKGROUP as mentioned in minimal smb.conf.


(testparm) syntax check smb.conf/usr/bin/testparm

To verify the syntax of the smb.conf file, you can use testparm.

$ testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[firstshare]"
Loaded services file OK.
Server role: ROLE_STANDALONE

testparm -v option gives output all the global options with their default value.

testparm -s option allows you to do the smallest possible samba configuration file and it also retain all the settings.


Smbclient (/usr/bin/smbclient)


Smbclient display all your shares, your workgroup, and the name of the Master Browser.

The -N switch is added to avoid having to enter an empty password. The -L switch is followed by the name of the host to check.

Some examples are:
smbclient -NL user
smbclient -NL 192.168.10.52
smbclient -L w2003 -U user


smbtree (/usr/bin/smbtree)


smbtree will do an anonymous browsing on the local subnet and display all samba shared computers.

net view


Net view is used in Windows server to see the shared Linux Samba Server.

C:\Documents and Settings\Administrator>net view




No comments: