File sharing program - Samba configuration in Red Hat Enterprise Linux 6


Need to know how to share files between Linux and Windows? Get started with Samba to share file between your RHEL 6 and Windows OS. Here you can get the details about configuring Samba in Red Hat Enterprise Linux 6 or RHEL 6. I have given steps to share home directory across network using Samba file sharing. Read the below article to learn Samba configuration in RHEL 6.

Samba RHEL 6 - Samba is file-sharing program widely used between Linux server and Windows client. Samba uses the same file-sharing protocol as Microsoft Windows. Samba program is required to share the Linux file system with Microsoft Windows. In this article I have explained how to install and configure Samba program in Red Hat Enterprise Linux 6. Samaba program is available by default in Red Hat official repository. So you need to install the required packages to configured Samba server in RHEL 6. Using Samba either directory or a printer can be shared to a network.

Packages for Samba


To install Samba, open the terminal and enter the following command.

#yum install samba* -y

This will install all the necessary packages such as configuration files and documentation files in your RHEL 6. Samba package contains only one RPM file which will be available in default RHEL 6 repository. The RPM file that will be available in Samba package is samba-windbind. This RPM file holds all the configuration file to connect a computer to a Samba server, sharing directories or printer over network. The daemon used by Samba program is smbd and smb.conf is the configuration where you will add new Samba users.

Samba configuration in RHEL 6


As I already said, smb.conf is used to configure Samba. You need to make following changes in the configuration file.

#vi /etc/samba/smb.conf

The above command is used to open the configuration file. Make the below given modification.

workgroup = FACULTY (in line number 74)
hosts allow = 172.24.100. ( in line number 80)

Then in the end of the document write the following configuration.

[model]
path = /bytes
browsable = yes
public = yes
writable = yes
printable = yes
valid user = venkat

Save the above configuration.

Now you need to add new user account and password in smbpasswd program. In Samba user should be created in order to share the files across network. The user account and password you create will be stored in smbpasswd. To add a new user.

#smbpasswd -a venkat

You will prompted to enter password. You should enter the password twice.

Next step is to set the Boolean value of Samba home directory as true.

#setsebool -P samba_enable_home_dirs=1
#chcon -Rt samba_share_t /bytes

To start the smb daemon automatically after reboot we should use

#chckconfig smb on

Start the smb service to share the bytes directory.

#service smb start

You can look at the shared bytes directory by running the following command.

#smbclient //localhost/model -U venkat

Replace share folder path insted of localhost/model. Enter the password to gain access to bytes directory. After successful configuration you will able to reach below state as show in image.

samba login

Read Overview of Runlevels in Linux/Unix


Comments



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: