{"id":2047,"date":"2012-02-20T22:42:37","date_gmt":"2012-02-20T14:42:37","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=2047"},"modified":"2023-04-28T09:49:55","modified_gmt":"2023-04-28T09:49:55","slug":"how-to-install-and-configure-samba-server-on-rhel-6","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-and-configure-samba-server-on-rhel-6\/","title":{"rendered":"How to Install and Configure Samba Server on RHEL 6"},"content":{"rendered":"<p>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.<\/p>\n<p>1. Install samba, portmap or rpcbind and xinetd service :<\/p>\n<pre class=\"code\">[root@rhel6 ~]# yum install samba-* portmap xinetd -y\nLoaded plugins: rhnplugin\nThis system is not registered with RHN.\nRHN support will be disabled.\nSetting up Install Process\nResolving Dependencies\n--&gt; Running transaction check\n---&gt; Package rpcbind.i686 0:0.2.0-8.el6 set to be updated\n---&gt; Package samba.i686 0:3.5.4-68.el6 set to be updated\n---&gt; Package samba-client.i686 0:3.5.4-68.el6 set to be updated\n---&gt; Package samba-common.i686 0:3.5.4-68.el6 set to be updated\n---&gt; Package samba-winbind.i686 0:3.5.4-68.el6 set to be updated\n---&gt; Package samba-winbind-clients.i686 0:3.5.4-68.el6 set to be updated\n---&gt; Package xinetd.i686 2:2.3.14-29.el6 set to be updated\n--&gt; Finished Dependency Resolution\n\nDependencies Resolved\n\n====================================================================================================\n Package                      Arch        Version                 Repository                   Size\n====================================================================================================\nInstalling:\n rpcbind                      i686        0.2.0-8.el6             DVD-RHEL6-Repository         50 k\n samba                        i686        3.5.4-68.el6            DVD-RHEL6-Repository        5.0 M\n samba-client                 i686        3.5.4-68.el6            DVD-RHEL6-Repository         11 M\n samba-common                 i686        3.5.4-68.el6            DVD-RHEL6-Repository         13 M\n samba-winbind                i686        3.5.4-68.el6            DVD-RHEL6-Repository        3.5 M\n samba-winbind-clients        i686        3.5.4-68.el6            DVD-RHEL6-Repository        1.1 M\n xinetd                       i686        2:2.3.14-29.el6         DVD-RHEL6-Repository        121 k\n\nTransaction Summary\n====================================================================================================\nInstall       7 Package(s)\nUpgrade       0 Package(s)\n\nTotal download size: 34 M\nInstalled size: 121 M\nDownloading Packages:\n----------------------------------------------------------------------------------------------------\nTotal                                                                42 MB\/s |  34 MB     00:00\nRunning rpm_check_debug\nRunning Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n  Installing     : samba-winbind-clients-3.5.4-68.el6.i686                                      1\/7\n  Installing     : samba-common-3.5.4-68.el6.i686                                               2\/7\n  Installing     : samba-3.5.4-68.el6.i686                                                      3\/7\n  Installing     : samba-client-3.5.4-68.el6.i686                                               4\/7\n  Installing     : samba-winbind-3.5.4-68.el6.i686                                              5\/7\n  Installing     : 2:xinetd-2.3.14-29.el6.i686                                                  6\/7\n  Installing     : rpcbind-0.2.0-8.el6.i686                                                     7\/7\n\nInstalled:\n  rpcbind.i686 0:0.2.0-8.el6                   samba.i686 0:3.5.4-68.el6\n  samba-client.i686 0:3.5.4-68.el6             samba-common.i686 0:3.5.4-68.el6\n  samba-winbind.i686 0:3.5.4-68.el6            samba-winbind-clients.i686 0:3.5.4-68.el6\n  xinetd.i686 2:2.3.14-29.el6\n\nComplete!<\/pre>\n<p>2. On RHEL 6, portmap is called and replaced by rpcbind. Make sure rpcbind and xinetd is start :<\/p>\n<pre class=\"code\">[root@rhel6 ~]# service rpcbind start\nStarting rpcbind:                                          [  OK  ]\n[root@rhel6 ~]# service xinetd start\nStarting xinetd:                                           [  OK  ]<\/pre>\n<p>3. Set rpcbind and xinetd start at boot :<\/p>\n<pre class=\"code\">[root@rhel6 ~]# chkconfig rpcbind on\n[root@rhel6 ~]# chkconfig xinetd on<\/pre>\n<p>4. Check rpcbind and xinetd service status :<\/p>\n<pre class=\"code\">[root@rhel6 ~]# service rpcbind status\nrpcbind (pid  2737) is running...\n[root@rhel6 ~]# service xinetd status\nxinetd (pid  2750) is running...<\/pre>\n<p>5. Create a normal user named sambauser1 :<\/p>\n<pre class=\"code\">[root@rhel6 ~]# useradd sambauser1\n[root@rhel6 ~]# passwd sambauser1\nChanging password for user sambauser1.\nNew password:\nRetype new password:\npasswd: all authentication tokens updated successfully.<\/pre>\n<p>6. Create \/smb directory and grant it full permission :<\/p>\n<pre class=\"code\">[root@rhel6 ~]# mkdir \/smb\n[root@rhel6 ~]# chmod 777 \/smb<\/pre>\n<p>7. Open and modify \/etc\/samba\/smb.conf main samba configuration files :<\/p>\n<pre class=\"code\">[root@rhel6 ~]# vi \/etc\/samba\/smb.conf<\/pre>\n<pre class=\"code\">#\n# Hosts Allow\/Hosts Deny lets you restrict who can connect, and you can\n# specifiy it as a per share option as well\n#\n        workgroup = MSHOME\n        server string = Samba Server Version %v\n\n;       netbios name = MYSERVER\n\n;       interfaces = lo eth0 192.168.12.2\/24 192.168.13.2\/24\n        hosts allow = 127. 192.168.12. 192.168.13. 192.168.1.<\/pre>\n<pre class=\"code\"># Add this line to share at the bottom of the config file :\n[smb]\ncomment = Personal stuff\npath = \/smb\npublic = no\nwritable = yes\nprintable = no\nbrowseable = yes\nwrite list = sambauser1<\/pre>\n<p>8. Now add sambauser1 user to samba user :<\/p>\n<pre class=\"code\">[root@rhel6 ~]# smbpasswd -a sambauser1\nNew SMB password:\nRetype new SMB password:\ntdbsam_open: Converting version 0.0 database to version 4.0.\ntdbsam_convert_backup: updated \/var\/lib\/samba\/private\/passdb.tdb file.\naccount_policy_get: tdb_fetch_uint32 failed for type 1 (min password length), returning 0\naccount_policy_get: tdb_fetch_uint32 failed for type 2 (password history), returning 0\naccount_policy_get: tdb_fetch_uint32 failed for type 3 (user must logon to change password), returning 0\naccount_policy_get: tdb_fetch_uint32 failed for type 4 (maximum password age), returning 0\naccount_policy_get: tdb_fetch_uint32 failed for type 5 (minimum password age), returning 0\naccount_policy_get: tdb_fetch_uint32 failed for type 6 (lockout duration), returning 0\naccount_policy_get: tdb_fetch_uint32 failed for type 7 (reset count minutes), returning 0\naccount_policy_get: tdb_fetch_uint32 failed for type 8 (bad lockout attempt), returning 0\naccount_policy_get: tdb_fetch_uint32 failed for type 9 (disconnect time), returning 0\naccount_policy_get: tdb_fetch_uint32 failed for type 10 (refuse machine password change), returning 0\nAdded user sambauser1.<\/pre>\n<p>9. Set smb service auto start at boot :<\/p>\n<pre class=\"code\">[root@rhel6 ~]# chkconfig smb on\n[root@rhel6 ~]# service smb start\nStarting SMB services:                                     [  OK  ]<\/pre>\n<p>10. Check smb current status :<\/p>\n<pre class=\"code\">[root@rhel6 ~]# service smb status\nsmbd (pid  2823) is running...<\/pre>\n<p>11. Stop iptables and makesure selinux is disabled :<\/p>\n<pre class=\"code\">[root@rhel6 ~]# service ip6tables stop\nip6tables: Flushing firewall rules:                        [  OK  ]\nip6tables: Setting chains to policy ACCEPT: filter         [  OK  ]\nip6tables: Unloading modules:                              [  OK  ]\n[root@rhel6 ~]# service iptables stop\niptables: Flushing firewall rules:                         [  OK  ]\niptables: Setting chains to policy ACCEPT: filter          [  OK  ]\niptables: Unloading modules:                               [  OK  ]\n[root@rhel6 ~]# setenforce 0\nsetenforce: SELinux is disabled<\/pre>\n<p>12. Check whether samba port opened and running :<\/p>\n<pre class=\"code\">[root@rhel6 ~]# netstat -plunt | grep smbd\ntcp        0      0 :::139                      :::*                        LISTEN      3212\/smbd\ntcp        0      0 :::445                      :::*                        LISTEN      3212\/smbd<\/pre>\n<p>13. Go on windows system and ping samba server. Make sure workgroup = MSHOME and allow 192.168.1.x network.<br \/>\n<img decoding=\"async\" class=\"alignnone lazyload\" title=\"samba\" data-src=\"http:\/\/3.bp.blogspot.com\/-esuBD0kKRNI\/T0JXSgosaiI\/AAAAAAAAByg\/Du8tt-y9rt8\/s1600\/0.PNG\" alt=\"samba\" width=\"327\" height=\"391\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 327px; --smush-placeholder-aspect-ratio: 327\/391;\" \/><br \/>\n14. Enter share path.<br \/>\n<img decoding=\"async\" class=\"alignnone lazyload\" title=\"samba\" data-src=\"http:\/\/3.bp.blogspot.com\/-HnuDl3CqE7Q\/T0JWPFrC5kI\/AAAAAAAABx8\/TFzPLzHhf4A\/s1600\/1.PNG\" alt=\"samba\" width=\"347\" height=\"186\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 347px; --smush-placeholder-aspect-ratio: 347\/186;\" \/><br \/>\n15. First try to login from sambauser1 account :<br \/>\n<img decoding=\"async\" class=\"alignnone lazyload\" title=\"samba\" data-src=\"http:\/\/4.bp.blogspot.com\/-GdLCesIGCeQ\/T0JWPZ1yAkI\/AAAAAAAAByI\/Mm898WSkGww\/s1600\/2.PNG\" alt=\"samba\" width=\"326\" height=\"289\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 326px; --smush-placeholder-aspect-ratio: 326\/289;\" \/><br \/>\n16. Samba successfully connected. You can start to upload now :<br \/>\n<img decoding=\"async\" class=\"alignnone lazyload\" title=\"samba\" data-src=\"http:\/\/1.bp.blogspot.com\/-t3Bj8M8Udec\/T0JWpxjJarI\/AAAAAAAAByU\/aFLOT0TkLmE\/s1600\/3.PNG\" alt=\"samba\" width=\"575\" height=\"375\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 575px; --smush-placeholder-aspect-ratio: 575\/375;\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230;<\/p>\n","protected":false},"author":6,"featured_media":1499,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1043,1049],"tags":[1536,1603,1663,1713,1715,1725,1733],"class_list":["post-2047","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-samba","category-selinux","tag-linux","tag-nfs","tag-portmap","tag-rhel","tag-rhel-6","tag-rpcbind","tag-samba"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2047","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=2047"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2047\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/1499"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=2047"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=2047"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=2047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}