Technowine

The Search Ends Here

How To configure a samba share on redhat/linux?

Posted by admin On September - 18 - 2009

logo-sambaSometimes your network may consists of Windows and Linux system.Samba server is the viable solution for file and printer sharing between linux and windows machines. Samba allows files and printers to be shared by all the systems in a network.
For networks having only Linux system we should go for NFS server.On how to configure NFS share read this
Samba server uses the SMB protocol for sharing files and printers across the network.

For configuration for samba server we need to install samba rpm packages.
For installing package:
# rpm -ivh samba
If your system supports yum installation use:
# yum –y install samba

If your system does not support yum installation you can configure yum server for your network. For configuring yum server read this

The default configuration file for samba is /etc/samba/smb.conf which allows users to view their home directories as a Samba share. It also shares all printers configured for the system as Samba shared printers.

If you change this configuration file, the changes do not take effect until you restart the Samba daemon with the following command .
# service smb restart.

To specify the Windows workgroup , edit the following lines in your smb.conf file:
workgroup = WORKGROUPNAME
If you want to restrict users to access samba share only form your domain then
In section1:
host allow = your domain ip-address

To create a samba share which can be accessed on windows.Go to the last section of the configuration file for samba and add the following lines

[sharename]
comment = Insert a comment here
path = /home/share/
valid users = tfox carole
public = no
writable = yes
printable = no

You then need to add samba password for the valid users which will access the samba share on the windows machine

#smbpasswd –a username

#service smb restart

To enable service start after the reboot:

#chkconfig smb on

Samba also provides you with a utility called testparm for checking its default configuration file.
# testparm
The above command will show you all the shared folders and printers.

One can also login into the samba share on linux machine with the following command.

#smbclient //ip-address/share-name –U username
Enter the password prompted for and access the samba share.

Related articles
How to configure dhcp server on redhat/linux

How to make a nfs server

Connect to me on Facebook

Leave a Reply

Sponsors

About Me

Hello everyone, My name is Jaskiran Singh and I am currently pursuing B. Tech final year from Maharaja Agrasen Institute of technology.I am currently RHCT,RHCE,RHCSS certified.

Twitter

    Photos

    Activate the Flickrss plugin to see the image thumbnails!