How to Setup Samba SWAT on CentOS 6.5

Samba service can provides files haring and printing services to its clients. System administrator can install SWAT in order to configure samba and perform samba administration from the web browser. In this post i will show simple steps to get Samba SWAT running on your CentOS 6.5 server. With SWAT, you can easily manage your samba server without messing with command line. You just need to install xinetd together with samba-SWAT software.

1. Install samba-swat and xinetd :

[root@samba ~]# yum install samba-swat xinetd -y

2. Software install will be as below :

====================================================================================================
 Package                        Arch            Version                      Repository        Size
====================================================================================================
Installing:
 samba-swat                     x86_64          3.6.9-167.el6_5              updates          7.3 M
Installing for dependencies:
 libtalloc                      x86_64          2.0.7-2.el6                  base              20 k
 libtdb                         x86_64          1.2.10-1.el6                 base              33 k
 libtevent                      x86_64          0.9.18-3.el6                 base              26 k
 samba                          x86_64          3.6.9-167.el6_5              updates          5.0 M
 samba-common                   x86_64          3.6.9-167.el6_5              updates           10 M
 samba-winbind                  x86_64          3.6.9-167.el6_5              updates          2.1 M
 samba-winbind-clients          x86_64          3.6.9-167.el6_5              updates          2.0 M
 xinetd                         x86_64          2:2.3.14-39.el6_4            base             121 k

Transaction Summary
====================================================================================================
Install       9 Package(s)

Total download size: 27 M
Installed size: 85 M

3. Add 192.168.0.0/24 network and enable swat by set ‘disable’ to ‘no’.

# default: off
# description: SWAT is the Samba Web Admin Tool. Use swat \
#              to configure your Samba server. To use SWAT, \
#              connect to port 901 with your favorite web browser.
service swat
{
        port            = 901
        socket_type     = stream
        wait            = no
        only_from       = 127.0.0.1 192.168.0.0/16
        user            = root
        server          = /usr/sbin/swat
        log_on_failure  += USERID
        disable         = no
}

4. Start the xinetd service :

[root@samba ~]# service xinetd start
Starting xinetd:                                           [  OK  ]

5. Make xinetd auto start at boot :

[root@samba ~]# chkconfig xinetd on

6. Access to [http://(server’s IP address):901] and enter root login password.

How to Mount a Windows Shared Folder in Linux CentOS 6.3

In this post, i will share on how to mount windows share folder on linux CentOS 6.3 server. Assumed that windows share folder has been configured properly with administrator privileged. This uses Common Internet File System (CIFS) protocol. CIFS can lets you access to shared folder and files that are remotely on the server and can do read and write to them.

Windows Share: //192.168.2.51/Files
Windows Credentials : username=administrator,password=mypassword

1. Execute the following command to mount Windows share folder :

[root@centos63 /]# mount -t cifs -o username=administrator,password=mypassword //192.168.2.51/Files /mnt

2. Verify that Windows share folder already mounted to /mnt :

[root@centos63 /]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vg_centos63-lv_root
                       5716804   2451228   2975172  46% /
tmpfs                   515400         0    515400   0% /dev/shm
/dev/sda1               495844     66280    403964  15% /boot
//192.168.2.51/Files 476403708 343375460 133028248  73% /mnt

3. Add that Windows share folder into /etc/fstab file, so that it will auto mount once rebooted :

[root@centos63 ~]# vi /etc/fstab

Add the final line as below :

#
# /etc/fstab
# Created by anaconda on Sun Jul 15 20:17:38 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_centos63-lv_root /                       ext4    defaults        1 1
UUID=2217c7b1-4467-4c81-8596-c3ee7758e2cc /boot                   ext4    defaults        1 2
/dev/mapper/vg_centos63-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
//192.168.2.51/Files    /mnt                    cifs    username=administrator,password=mypassword 0 0

How to Install and Configure Samba SWAT on CentOS 5.5

SWATSWAT is the Samba Web Administration Tool that enable us to configure Samba from Web browser. In this post i will show simple steps to get Samba SWAT running on your CentOS 5.5 server. With SWAT, you can easily manage your samba server without messing with command line. You just need to install xinetd first, and then proceed to install samba-SWAT.

1. Install xinetd

    [root@server ~]# yum -y install xinetd
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * addons: ossm.utm.my
     * base: ossm.utm.my
     * epel: mirror01.idc.hinet.net
     * extras: ossm.utm.my
     * updates: ossm.utm.my
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package xinetd.i386 2:2.3.14-10.el5 set to be updated
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ==========================================================================================
     Package            Arch             Version                       Repository        Size
    ==========================================================================================
    Installing:
     xinetd             i386             2:2.3.14-10.el5               base             124 k
    
    Transaction Summary
    ==========================================================================================
    Install       1 Package(s)
    Upgrade       0 Package(s)
    
    Total download size: 124 k
    Downloading Packages:
    xinetd-2.3.14-10.el5.i386.rpm                                      | 124 kB     00:02
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : xinetd                                                             1/1
    
    Installed:
      xinetd.i386 2:2.3.14-10.el5
    
    Complete!
    

2. Start xinetd

    [root@server ~]# /etc/rc.d/init.d/xinetd start
    Starting xinetd:                                           [  OK  ]
    

3. Install SWAT

    [root@server ~]# yum -y install samba-swat
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * addons: ossm.utm.my
     * base: ossm.utm.my
     * epel: mirror01.idc.hinet.net
     * extras: ossm.utm.my
     * updates: ossm.utm.my
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package samba-swat.i386 0:3.0.33-3.29.el5_6.2 set to be updated
    --> Processing Dependency: samba = 3.0.33-3.29.el5_6.2 for package: samba-swat
    --> Running transaction check
    ---> Package samba.i386 0:3.0.33-3.29.el5_6.2 set to be updated
    --> Processing Dependency: samba-common = 3.0.33-3.29.el5_6.2 for package: samba
    --> Running transaction check
    ---> Package samba-common.i386 0:3.0.33-3.29.el5_6.2 set to be updated
    --> Processing Dependency: libsmbclient = 3.0.33-3.29.el5_6.2 for package: samba-common
    --> Running transaction check
    ---> Package libsmbclient.i386 0:3.0.33-3.29.el5_6.2 set to be updated
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ==========================================================================================
     Package               Arch          Version                       Repository        Size
    ==========================================================================================
    Installing:
     samba-swat            i386          3.0.33-3.29.el5_6.2           updates          8.2 M
    Installing for dependencies:
     samba                 i386          3.0.33-3.29.el5_6.2           updates           16 M
    Updating for dependencies:
     libsmbclient          i386          3.0.33-3.29.el5_6.2           updates          908 k
     samba-common          i386          3.0.33-3.29.el5_6.2           updates          6.7 M
    
    Transaction Summary
    ==========================================================================================
    Install       2 Package(s)
    Upgrade       2 Package(s)
    
    Total download size: 32 M
    Downloading Packages:
    (1/4): libsmbclient-3.0.33-3.29.el5_6.2.i386.rpm                   | 908 kB     00:16
    (2/4): samba-common-3.0.33-3.29.el5_6.2.i386.rpm                   | 6.7 MB     02:01
    (3/4): samba-swat-3.0.33-3.29.el5_6.2.i386.rpm                     | 8.2 MB     02:28
    (4/4): samba-3.0.33-3.29.el5_6.2.i386.rpm                          |  16 MB     05:11
    ------------------------------------------------------------------------------------------
    Total                                                      55 kB/s |  32 MB     09:59
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Updating       : libsmbclient                                                       1/6
      Updating       : samba-common                                                       2/6
      Installing     : samba                                                              3/6
      Installing     : samba-swat                                                         4/6
      Cleanup        : libsmbclient                                                       5/6
      Cleanup        : samba-common                                                       6/6
    
    Installed:
      samba-swat.i386 0:3.0.33-3.29.el5_6.2
    
    Dependency Installed:
      samba.i386 0:3.0.33-3.29.el5_6.2
    
    Dependency Updated:
      libsmbclient.i386 0:3.0.33-3.29.el5_6.2     samba-common.i386 0:3.0.33-3.29.el5_6.2
    
    Complete!
    

4. Configure swat as below. Change Line 10 and 14 only.

    [root@server ~]# vi /etc/xinetd.d/swat
    
    # default: off
    # description: SWAT is the Samba Web Admin Tool. Use swat \
    #              to configure your Samba server. To use SWAT, \
    #              connect to port 901 with your favorite web browser.
    service swat
    {
            port            = 901
            socket_type     = stream
            wait            = no
            only_from       = 127.0.0.1 192.168.2.0/16
            user            = root
            server          = /usr/sbin/swat
            log_on_failure  += USERID
            disable         = no
    }
    

5. Restart xinetd

    [root@server ~]# /etc/rc.d/init.d/xinetd restart
    Stopping xinetd:                                           [  OK  ]
    Starting xinetd:                                           [  OK  ]
    

How to Install SWAT to Configure Samba from Web browser on CentOS 6.2

SWAT is a Samba Web Administration Tool. SWAT is a facility that is part of the Samba suite. SWAT allows a Samba administrator to configure the complex smb.conf. In this post, i will share on how to install and configure SWAT to Configure Samba on linux CentOS 6.2 server.

1. Run this command to install samba SWAT :

[root@centos62 ~]# yum install xinetd samba-swat -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ipserverone.com
 * extras: centos.ipserverone.com
 * updates: centos.ipserverone.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package samba-swat.i686 0:3.5.10-114.el6 will be installed
--> Processing Dependency: samba = 3.5.10-114.el6 for package: samba-swat-3.5.10-114.el6.i686
--> Processing Dependency: samba-winbind-clients = 3.5.10-114.el6 for package: samba-swat-3.5.10-114.el6.i686
--> Processing Dependency: libwbclient.so.0 for package: samba-swat-3.5.10-114.el6.i686
---> Package xinetd.i686 2:2.3.14-33.el6 will be installed
--> Running transaction check
---> Package samba.i686 0:3.5.10-114.el6 will be installed
--> Processing Dependency: samba-common = 3.5.10-114.el6 for package: samba-3.5.10-114.el6.i686
---> Package samba-winbind-clients.i686 0:3.5.10-114.el6 will be installed
--> Running transaction check
---> Package samba-common.i686 0:3.5.10-114.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                          Arch            Version                     Repository       Size
====================================================================================================
Installing:
 samba-swat                       i686            3.5.10-114.el6              base            3.0 M
 xinetd                           i686            2:2.3.14-33.el6             base            121 k
Installing for dependencies:
 samba                            i686            3.5.10-114.el6              base            5.0 M
 samba-common                     i686            3.5.10-114.el6              base             13 M
 samba-winbind-clients            i686            3.5.10-114.el6              base            1.1 M

Transaction Summary
====================================================================================================
Install       5 Package(s)

Total download size: 22 M
Installed size: 81 M
Downloading Packages:
(1/5): samba-3.5.10-114.el6.i686.rpm                                         | 5.0 MB     03:00
(2/5): samba-common-3.5.10-114.el6.i686.rpm                                  |  13 MB     07:32
(3/5): samba-swat-3.5.10-114.el6.i686.rpm                                    | 3.0 MB     01:40
(4/5): samba-winbind-clients-3.5.10-114.el6.i686.rpm                         | 1.1 MB     00:38
(5/5): xinetd-2.3.14-33.el6.i686.rpm                                         | 121 kB     00:03
----------------------------------------------------------------------------------------------------
Total                                                                30 kB/s |  22 MB     12:57
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : samba-winbind-clients-3.5.10-114.el6.i686                                        1/5
  Installing : samba-common-3.5.10-114.el6.i686                                                 2/5
  Installing : samba-3.5.10-114.el6.i686                                                        3/5
  Installing : 2:xinetd-2.3.14-33.el6.i686                                                      4/5
  Installing : samba-swat-3.5.10-114.el6.i686                                                   5/5

Installed:
  samba-swat.i686 0:3.5.10-114.el6                    xinetd.i686 2:2.3.14-33.el6

Dependency Installed:
  samba.i686 0:3.5.10-114.el6                           samba-common.i686 0:3.5.10-114.el6
  samba-winbind-clients.i686 0:3.5.10-114.el6

Complete!

2. Open swat configuration file :

[root@centos62 ~]# vi /etc/xinetd.d/swat

3. Add IP address you permit. In this example, i will add 192.168.1.0/24 network and enable swat by set ‘disable’ to ‘no’.

Original configuration file :

# default: off
# description: SWAT is the Samba Web Admin Tool. Use swat \
#              to configure your Samba server. To use SWAT, \
#              connect to port 901 with your favorite web browser.
service swat
{
        port            = 901
        socket_type     = stream
        wait            = no
        only_from       = 127.0.0.1
        user            = root
        server          = /usr/sbin/swat
        log_on_failure  += USERID
        disable         = yes
}

Change to :

# default: off
# description: SWAT is the Samba Web Admin Tool. Use swat \
#              to configure your Samba server. To use SWAT, \
#              connect to port 901 with your favorite web browser.
service swat
{
        port            = 901
        socket_type     = stream
        wait            = no
        only_from       = 127.0.0.1 192.168.1.0/24
        user            = root
        server          = /usr/sbin/swat
        log_on_failure  += USERID
        disable         = no
}

4. Start xinetd service :

[root@centos62 ~]# /etc/rc.d/init.d/xinetd start
Starting xinetd:                                           [  OK  ]

5. Enable xinetd service auto start at boot :

[root@centos62 ~]# chkconfig xinetd on

How to Install and Configure Samba Server on RHEL 6

In this post i will show on how to install and configure a Samba server an also how to transfer files from client side. For this example we are using two systems one Red Hat Enterprise Linux (RHEL 6) server one Window XP clients.

1. Install samba, portmap or rpcbind and xinetd service :

[root@rhel6 ~]# yum install samba-* portmap xinetd -y
Loaded plugins: rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package rpcbind.i686 0:0.2.0-8.el6 set to be updated
---> Package samba.i686 0:3.5.4-68.el6 set to be updated
---> Package samba-client.i686 0:3.5.4-68.el6 set to be updated
---> Package samba-common.i686 0:3.5.4-68.el6 set to be updated
---> Package samba-winbind.i686 0:3.5.4-68.el6 set to be updated
---> Package samba-winbind-clients.i686 0:3.5.4-68.el6 set to be updated
---> Package xinetd.i686 2:2.3.14-29.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                      Arch        Version                 Repository                   Size
====================================================================================================
Installing:
 rpcbind                      i686        0.2.0-8.el6             DVD-RHEL6-Repository         50 k
 samba                        i686        3.5.4-68.el6            DVD-RHEL6-Repository        5.0 M
 samba-client                 i686        3.5.4-68.el6            DVD-RHEL6-Repository         11 M
 samba-common                 i686        3.5.4-68.el6            DVD-RHEL6-Repository         13 M
 samba-winbind                i686        3.5.4-68.el6            DVD-RHEL6-Repository        3.5 M
 samba-winbind-clients        i686        3.5.4-68.el6            DVD-RHEL6-Repository        1.1 M
 xinetd                       i686        2:2.3.14-29.el6         DVD-RHEL6-Repository        121 k

Transaction Summary
====================================================================================================
Install       7 Package(s)
Upgrade       0 Package(s)

Total download size: 34 M
Installed size: 121 M
Downloading Packages:
----------------------------------------------------------------------------------------------------
Total                                                                42 MB/s |  34 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : samba-winbind-clients-3.5.4-68.el6.i686                                      1/7
  Installing     : samba-common-3.5.4-68.el6.i686                                               2/7
  Installing     : samba-3.5.4-68.el6.i686                                                      3/7
  Installing     : samba-client-3.5.4-68.el6.i686                                               4/7
  Installing     : samba-winbind-3.5.4-68.el6.i686                                              5/7
  Installing     : 2:xinetd-2.3.14-29.el6.i686                                                  6/7
  Installing     : rpcbind-0.2.0-8.el6.i686                                                     7/7

Installed:
  rpcbind.i686 0:0.2.0-8.el6                   samba.i686 0:3.5.4-68.el6
  samba-client.i686 0:3.5.4-68.el6             samba-common.i686 0:3.5.4-68.el6
  samba-winbind.i686 0:3.5.4-68.el6            samba-winbind-clients.i686 0:3.5.4-68.el6
  xinetd.i686 2:2.3.14-29.el6

Complete!

2. On RHEL 6, portmap is called and replaced by rpcbind. Make sure rpcbind and xinetd is start :

[root@rhel6 ~]# service rpcbind start
Starting rpcbind:                                          [  OK  ]
[root@rhel6 ~]# service xinetd start
Starting xinetd:                                           [  OK  ]

3. Set rpcbind and xinetd start at boot :

[root@rhel6 ~]# chkconfig rpcbind on
[root@rhel6 ~]# chkconfig xinetd on

4. Check rpcbind and xinetd service status :

[root@rhel6 ~]# service rpcbind status
rpcbind (pid  2737) is running...
[root@rhel6 ~]# service xinetd status
xinetd (pid  2750) is running...

5. Create a normal user named sambauser1 :

[root@rhel6 ~]# useradd sambauser1
[root@rhel6 ~]# passwd sambauser1
Changing password for user sambauser1.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

6. Create /smb directory and grant it full permission :

[root@rhel6 ~]# mkdir /smb
[root@rhel6 ~]# chmod 777 /smb

7. Open and modify /etc/samba/smb.conf main samba configuration files :

[root@rhel6 ~]# vi /etc/samba/smb.conf
#
# Hosts Allow/Hosts Deny lets you restrict who can connect, and you can
# specifiy it as a per share option as well
#
        workgroup = MSHOME
        server string = Samba Server Version %v

;       netbios name = MYSERVER

;       interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
        hosts allow = 127. 192.168.12. 192.168.13. 192.168.1.
# Add this line to share at the bottom of the config file :
[smb]
comment = Personal stuff
path = /smb
public = no
writable = yes
printable = no
browseable = yes
write list = sambauser1

8. Now add sambauser1 user to samba user :

[root@rhel6 ~]# smbpasswd -a sambauser1
New SMB password:
Retype new SMB password:
tdbsam_open: Converting version 0.0 database to version 4.0.
tdbsam_convert_backup: updated /var/lib/samba/private/passdb.tdb file.
account_policy_get: tdb_fetch_uint32 failed for type 1 (min password length), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 2 (password history), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 3 (user must logon to change password), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 4 (maximum password age), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 5 (minimum password age), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 6 (lockout duration), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 7 (reset count minutes), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 8 (bad lockout attempt), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 9 (disconnect time), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 10 (refuse machine password change), returning 0
Added user sambauser1.

9. Set smb service auto start at boot :

[root@rhel6 ~]# chkconfig smb on
[root@rhel6 ~]# service smb start
Starting SMB services:                                     [  OK  ]

10. Check smb current status :

[root@rhel6 ~]# service smb status
smbd (pid  2823) is running...

11. Stop iptables and makesure selinux is disabled :

[root@rhel6 ~]# service ip6tables stop
ip6tables: Flushing firewall rules:                        [  OK  ]
ip6tables: Setting chains to policy ACCEPT: filter         [  OK  ]
ip6tables: Unloading modules:                              [  OK  ]
[root@rhel6 ~]# service iptables stop
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
[root@rhel6 ~]# setenforce 0
setenforce: SELinux is disabled

12. Check whether samba port opened and running :

[root@rhel6 ~]# netstat -plunt | grep smbd
tcp        0      0 :::139                      :::*                        LISTEN      3212/smbd
tcp        0      0 :::445                      :::*                        LISTEN      3212/smbd

13. Go on windows system and ping samba server. Make sure workgroup = MSHOME and allow 192.168.1.x network.
samba
14. Enter share path.
samba
15. First try to login from sambauser1 account :
samba
16. Samba successfully connected. You can start to upload now :
samba

Why “portmap unrecognized service” on RHEL 6/CentOS 6

Question :

During the deployment of Samba and NFS services on one of the RHEL 6 server, I’m hit by this message when trying to start, stop and restart service portmap :

[root@rhel6 ~]# service portmap start
portmap: unrecognized service

 

Answer :
Portmap is replaced by rpcbind on some linux distributions such as Fedora 8,RHEL 6 and CentOS 6. Portmap is now started and stopped as part of the rpcbind service. You may not able to find the portmap service, but you can see rpcbind instead.
http://www.archlinux.org

Command line below provides the required dependency packages. It can also be used to track a package containing a specific executable :

[root@rhel6 ~]# yum whatprovides portmap
Loaded plugins: rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
rpcbind-0.2.0-8.el6.i686 : Universal Addresses to RPC Program Number Mapper
Repo        : DVD-RHEL6-Repository
Matched from:
Other       : portmap

rpcbind-0.2.0-8.el6.i686 : Universal Addresses to RPC Program Number Mapper
Repo        : installed
Matched from:
Other       : Provides-match: portmap

When you try to install portmap on RHEL 6, it will install rpcbind instead :

[root@rhel6 ~]# yum install portmap -y
Loaded plugins: rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Package rpcbind-0.2.0-8.el6.i686 already installed and latest version
Nothing to do

What is Portmap :
Portmap is a server that converts RPC (Remote Procedure Call) program numbers into DARPA protocol port numbers. It must be running in order to make RPC calls. Server services that use RPC include NFS, NIS and Samba. When an RPC server is started, it will tell portmap what port number it is listening to, and what RPC program numbers it is prepared to serve. When a client wishes to make an RPC call to a given program number, it will first contact portmap on the server machine to determine the port number where RPC packets should be sent. Therefore, portmap must be started before any RPC servers are invoked. This because RPC-based services rely on portmap to make all connections with incoming client requests.

What is rpcbind :
rpcbind is a server that converts RPC program numbers into universal addresses. It must be running on the host to be able to make RPC calls on a server on that machine. When an RPC service is started, it tells rpcbind the address at which it is listening, and the RPC program numbers it is prepared to serve. When a client wishes to make an RPC call to a given program number, it first contacts rpcbind on the server machine to determine the address where RPC requests should be sent. rpcbind should be started before any other RPC service. Normally, standard RPC servers are started by port monitors, so rpcbind must be started before port monitors are invoked.

Server service that use RPC :
1. NFS
NFS uses Remote Procedure Calls (RPC) to route requests between clients and servers, meaning that the portmap service must be enabled and active at the proper runlevels for NFS communication to occur.

2. Samba
Samba is an Open Source software that based on the common client/server protocol of Server Message Block (SMB) and Common Internet File System (CIFS). It’s allows end users to access and use files, printers and sharing the company resources.

Example portmap instance
The rpcinfo command shows each RPC-based service with its port number, RPC program number, version, and IP protocol type (TCP or UDP). This is to make sure the proper NFS RPC-based services and portmapper are enabled for portmap.

[root@rhel6 ~]# rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  56670  status
    100024    1   tcp  54564  status

How to Install and Configure Samba Server on CentOS 6.2

In this post, i will show you on how to install samba service on CentOS 6.2. This post assumed that you have configure local yum repository.

    [root@centos62 ~]# yum install samba
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: centos.maulvi.net
     * extras: centos.maulvi.net
     * updates: centos.maulvi.net
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package samba.i686 0:3.5.10-114.el6 will be installed
    --> Processing Dependency: samba-winbind-clients = 3.5.10-114.el6 for package: samba-3.5.10-114.el6.i686
    --> Processing Dependency: samba-common = 3.5.10-114.el6 for package: samba-3.5.10-114.el6.i686
    --> Processing Dependency: libtdb.so.1 for package: samba-3.5.10-114.el6.i686
    --> Processing Dependency: libcups.so.2 for package: samba-3.5.10-114.el6.i686
    --> Processing Dependency: libwbclient.so.0 for package: samba-3.5.10-114.el6.i686
    --> Processing Dependency: libtalloc.so.2 for package: samba-3.5.10-114.el6.i686
    --> Running transaction check
    ---> Package cups-libs.i686 1:1.4.2-44.el6 will be installed
    --> Processing Dependency: libavahi-client.so.3 for package: 1:cups-libs-1.4.2-44.el6.i686
    --> Processing Dependency: libtiff.so.3 for package: 1:cups-libs-1.4.2-44.el6.i686
    --> Processing Dependency: libjpeg.so.62 for package: 1:cups-libs-1.4.2-44.el6.i686
    --> Processing Dependency: libavahi-common.so.3 for package: 1:cups-libs-1.4.2-44.el6.i686
    --> Processing Dependency: libpng12.so.0(PNG12_0) for package: 1:cups-libs-1.4.2-44.el6.i686
    --> Processing Dependency: libpng12.so.0 for package: 1:cups-libs-1.4.2-44.el6.i686
    ---> Package libtalloc.i686 0:2.0.1-1.1.el6 will be installed
    ---> Package libtdb.i686 0:1.2.1-3.el6 will be installed
    ---> Package samba-common.i686 0:3.5.10-114.el6 will be installed
    --> Processing Dependency: /usr/bin/pkg-config for package: samba-common-3.5.10-114.el6.i686
    ---> Package samba-winbind-clients.i686 0:3.5.10-114.el6 will be installed
    --> Running transaction check
    ---> Package avahi-libs.i686 0:0.6.25-11.el6 will be installed
    ---> Package libjpeg.i686 0:6b-46.el6 will be installed
    ---> Package libpng.i686 2:1.2.46-1.el6_1 will be installed
    ---> Package libtiff.i686 0:3.9.4-1.el6_0.3 will be installed
    ---> Package pkgconfig.i686 1:0.23-9.1.el6 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ====================================================================================================
     Package                      Arch        Version                 Repository                   Size
    ====================================================================================================
    Installing:
     samba                        i686        3.5.10-114.el6          CentOS6.2-Repository        5.0 M
    Installing for dependencies:
     avahi-libs                   i686        0.6.25-11.el6           CentOS6.2-Repository         54 k
     cups-libs                    i686        1:1.4.2-44.el6          CentOS6.2-Repository        324 k
     libjpeg                      i686        6b-46.el6               CentOS6.2-Repository        133 k
     libpng                       i686        2:1.2.46-1.el6_1        CentOS6.2-Repository        184 k
     libtalloc                    i686        2.0.1-1.1.el6           CentOS6.2-Repository         18 k
     libtdb                       i686        1.2.1-3.el6             CentOS6.2-Repository         29 k
     libtiff                      i686        3.9.4-1.el6_0.3         CentOS6.2-Repository        338 k
     pkgconfig                    i686        1:0.23-9.1.el6          CentOS6.2-Repository         67 k
     samba-common                 i686        3.5.10-114.el6          CentOS6.2-Repository         13 M
     samba-winbind-clients        i686        3.5.10-114.el6          CentOS6.2-Repository        1.1 M
    
    Transaction Summary
    ====================================================================================================
    Install      11 Package(s)
    
    Total download size: 20 M
    Installed size: 70 M
    Is this ok [y/N]: y
    Downloading Packages:
    ----------------------------------------------------------------------------------------------------
    Total                                                                10 MB/s |  20 MB     00:02
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing : libtalloc-2.0.1-1.1.el6.i686                                                    1/11
      Installing : libtdb-1.2.1-3.el6.i686                                                         2/11
      Installing : samba-winbind-clients-3.5.10-114.el6.i686                                       3/11
      Installing : libjpeg-6b-46.el6.i686                                                          4/11
      Installing : libtiff-3.9.4-1.el6_0.3.i686                                                    5/11
      Installing : 2:libpng-1.2.46-1.el6_1.i686                                                    6/11
      Installing : 1:pkgconfig-0.23-9.1.el6.i686                                                   7/11
      Installing : samba-common-3.5.10-114.el6.i686                                                8/11
      Installing : avahi-libs-0.6.25-11.el6.i686                                                   9/11
      Installing : 1:cups-libs-1.4.2-44.el6.i686                                                  10/11
      Installing : samba-3.5.10-114.el6.i686                                                      11/11
    
    Installed:
      samba.i686 0:3.5.10-114.el6
    
    Dependency Installed:
      avahi-libs.i686 0:0.6.25-11.el6              cups-libs.i686 1:1.4.2-44.el6
      libjpeg.i686 0:6b-46.el6                     libpng.i686 2:1.2.46-1.el6_1
      libtalloc.i686 0:2.0.1-1.1.el6               libtdb.i686 0:1.2.1-3.el6
      libtiff.i686 0:3.9.4-1.el6_0.3               pkgconfig.i686 1:0.23-9.1.el6
      samba-common.i686 0:3.5.10-114.el6           samba-winbind-clients.i686 0:3.5.10-114.el6
    
    Complete!
    

Set Samba auto after boot up :

    [root@centos62 ~]# chkconfig smb on
    

Start samba service :

    [root@centos62 ~]# service smb start
    Starting SMB services:                                     [  OK  ]