Friday, April 25, 2014

Configure SAMBA

        Samba

- It is used for sharing files and folder, Printer between linux and other operating system
- works on port no. 137,138,139
- Package Name         - Samba
- Service Name         - smb
- Configuration file    - /etc/samba/samba.conf

Check using RPM command is the package is installed or not

# rpm -qa samba
# rpm -qc samba        [Configuration]
# rpm -qd samba        [Documentation]
# rpm -ql samba        [List]

=================================================================================

    Samba - Server side

# yum install samba -y
# mkdir /share
# vim /etc/samba/smb.conf
  [global]
  domainname = WORKGROUP        // Enter domain name provided    LINE 74
  Allow hosts = 192.168.10.
  OR
  Allow hosts = 0.0.0.            // For ALL    LINE 74
  Shift+G
  [Share]
  [Comment=Samba Server]
  path = /share
  browsable = yes
  writable = yes
  valid users= harry
  :wq
# service smb restart
# chkconf smb on
# chcon -t samba_share_t  /share
# smbpasswd -a harry

------------------------------------------------------------------------------

    Samba - Client side

# smbclient -L //192.168.10.224 -U harry
OR , in web browser
smb://192.168.10.224

------------------------------------------------------------------------------

To View Samba Configuration File Contents

# testparm

------------------------------------------------------------------------------

Condition :
When we create a file under samba server (/share), it will show the owner as root and root as per samba server
If you want that to be changed on client side from server side

# vim /etc/samba/smb.conf
  [global]
  domainname = WORKGROUP        // Enter domain name provided    LINE 74
  Allow hosts = 192.168.10.
  OR
  Allow hosts = 0.0.0.            // For ALL    LINE 74
  Shift+G
  [Share]
  [Comment=Samba Server]
  path = /share
  public = yes
  browsable = yes
  writable = yes
  valid users= harry
  create mask = 766
  directory mask= 755
  force user = root
  force group = sales
  :wq
# service smb restart
 
==============================================================================================

No comments:

Post a Comment