Samba Server

Samba is a powerful tool for allowing UNIX-based systems (such as Linux) to interoperate with Windows-based systems. Samba does this by understanding the Microsoft networking protocol, Session Message Block (SMB). The SMB protocol is used by Windows machines for both file sharing and network printing. From a systems administrator’s point of view, this means being able to deploy a UNIX-based server on a predominantly Windows network without having to install Network File System. (NFS)

Install Packages for Samba

Samba is comprised of a suite of RPMs. The files are named
RPM of Samba server
RPM of Samba server

If your computer does not have these rpm then install these rpms.

Samba Started

You can start/stop/restart Samba after boot time using the smb initialization script as in the examples below:
[root @localhost ~]# service smb start
[root @localhost ~]# service smb stop
[root @localhost ~]# service smb restart
[root @localhost ~]# /etc/init.d/smb start
[root @localhost ~]# /etc/init.d/smb stop
[root @localhost ~]# /etc/init.d/smb restart

You can configure Samba to start at boot time using the chkconfig command:
[root@localhost]# chkconfig smb on

Configure Samba server step by step

Let us study the samba server configuration step by step.

Samba - Server side

  1. Create a normal user named whatever you like as shown in figure
    Samba server user creation
    Samba server user creation

  2. Now create a ( /wis) directory.
  3. Open /etc/samba/smb.conf main samba configuration files Make entry like this for user wisdom (this configuration for both read and write)
    Samba server /etc/samba/smb.conf  file
    Samba server /etc/samba/smb.conf file

  4. Now add wisdom user to samba user.
    Adding samba user
    Adding samba user

  5. Restart the service
    Samba server service restart
    Samba server service restart

    If service nmb does not start automatically use command
    [root@localhost ~]# service nmb restart

Samba server - At client side (Windows)

Open your network places
Go to search option. Select the search for computer Then give the ip of samba server as shown in figure
Samba server - client side
Samba client side

When samba computer is found click on the computer A window would be appeared
Samba server - client Authentication
Samba server - client Authentication

Username = wisdom
Password = as you gave in samba password
After this a you would see the one or more than one directory like this
Samba server access by client
Samba server access by client

The wis directory as we define in smb.conf file , wisdom directory is wisdom user home directory. Open the directories. Successfully open the directory.
Successfully accessing samba directory by client
Successfully accessing samba directory by client

Troubleshooting of samba server

Let us discuss some troubleshooting steps of samba server.
  1. Check the ip address (ping to server from client or vice versa should be successful ).
  2. Firewall or iptables should be turn off.
  3. Sometime directory may not be open.
    1. Give the permission to access the (#chmod 777 /wis)
    2. SElinux will be restricting the smb daemon , in this case turn off the SElinux Use command as shown in figure.
      Troubleshooting of samba server
      Troubleshooting of samba server