Showing posts with label Samba in Linux. Show all posts
Showing posts with label Samba in Linux. Show all posts

Wednesday, 10 June 2015

Step by step to configure Samba in RHEL 6


Step 1: Install necessary RPM

[root@stelar_test repodata]# ls -lrt sam*
-r--r--r--. 1 root root    30556 Aug 17  2010 samyak-malayalam-fonts-1.2.1-9.el6.noarch.rpm
-r--r--r--. 1 root root    49496 Aug 17  2010 samyak-gujarati-fonts-1.2.1-9.el6.noarch.rpm
-r--r--r--. 1 root root    18328 Aug 17  2010 samyak-fonts-common-1.2.1-9.el6.noarch.rpm
-r--r--r--. 1 root root    61720 Aug 17  2010 samyak-devanagari-fonts-1.2.1-9.el6.noarch.rpm
-r--r--r--. 1 root root    26936 Aug 17  2010 samyak-tamil-fonts-1.2.1-9.el6.noarch.rpm
-r--r--r--. 1 root root    66000 Aug 17  2010 samyak-oriya-fonts-1.2.1-9.el6.noarch.rpm
-r--r--r--. 1 root root  1116684 Nov  3  2011 samba-winbind-clients-3.5.10-114.el6.i686.rpm
-r--r--r--. 1 root root 13918292 Nov  3  2011 samba-common-3.5.10-114.el6.i686.rpm
-r--r--r--. 1 root root  1119920 Nov  3  2011 samba-winbind-clients-3.5.10-114.el6.x86_64.rpm
-r--r--r--. 1 root root 13999076 Nov  3  2011 samba-common-3.5.10-114.el6.x86_64.rpm
-r--r--r--. 1 root root  5217032 Nov  3  2011 samba-3.5.10-114.el6.x86_64.rpm
-r--r--r--. 1 root root  3726432 Nov  3  2011 samba-winbind-3.5.10-114.el6.x86_64.rpm
-r--r--r--. 1 root root 11488144 Nov  3  2011 samba-client-3.5.10-114.el6.x86_64.rpm
[root@stelar_test repodata]# rpm -Uvh samba-3.5.10-114.el6.x86_64.rpm
warning: samba-3.5.10-114.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:samba                  ########################################### [100%]
[root@stelar_test repodata]# rpm -Uvh samba-common-3.5.10-114.el6.x86_64.rpm
warning: samba-common-3.5.10-114.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
        package samba-common-0:3.5.10-114.el6.x86_64 is already installed
[root@stelar_test repodata]# rpm -Uvh samba-winbind-3.5.10-114.el6.x86_64.rpm
warning: samba-winbind-3.5.10-114.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:samba-winbind          ########################################### [100%]
 
Samba Daemons
For Samba we need three services to run, one optional and two required
Service Daemons Description
Required smb smbd (SMB/CIFS Server) main samba service which provide user authentication and authorization and file and printer sharing
Required nmb nmbd (NetBIOS name server) Resources browsing
Optional winbind winbindd For host and user name resolution

Step 2: If you have just installed RPM than these service would be stopped.


 
[root@stelar_test repodata]# service smb status
smbd is stopped
[root@stelar_test repodata]# service nmb status
nmbd is stopped
[root@stelar_test repodata]# service winbind status
winbindd is stopped

Step 3: Start necessary services

[root@stelar_test repodata]# service smb start
Starting SMB services:                                     [  OK  ]
[root@stelar_test repodata]# service nmb start
Starting NMB services:                                     [  OK  ]
[root@stelar_test repodata]# service winbind start
Starting Winbind services:                                 [  OK  ]

Step 4: Make sure the services are running at the next time Linux is booted

[root@stelar_test repodata]# chkconfig smb on
[root@stelar_test repodata]# chkconfig nmb on
[root@stelar_test repodata]# chkconfig winbind on
[root@stelar_test repodata]#

Step 5: Creating Samba Test Directory and Files

mkdir /smbdemo

Step 6: Change the permissions on the new directory to 770 with the following command:

chmod 770 /smbdemo


Step 7: Adding the Samba User and Creating the Samba Group

# adduser administrator
# passwd administrator
Changing password for user administrator
New UNIX password: ********
Retype new UNIX password: ********
passwd: all authentication tokens updated successfully.


You must add users to the Samba database in order for them to have access to their home directory and other Samba shares.

Step 8: Now open main configuration file of Samba

[root@stelar_test pen]# vim /etc/samba/smb.conf

[backup_cbs_usb]

comment= Linux Share Samba
path=/mnt/pen
browsable=yes
guest ok=yes
read only=no
create mask=0755

Note : Change the security value to share

security = share
        passdb backend = tdbsam

Step 9: Now restart the samba service 

[root@stelar_test pen]# service smb restart
Shutting down SMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]

Step 10: Now browse the samba directory from windows PC

\\192.168.10.177\backup_cbs_usb