SAMBA SERVER

SAMBA SERVER- 
Most Linux systems are the part of networks that also run Windows systems. Using Linux Samba servers, your Linux and Windows systems can share directories and printers. This is most use full situation where your clients are window native and you want to use the linux security features.


Package-  SAMBA
Port no-   137,138,139,445
Script-      /etc/init.d/smb
Daemon- smb
Configuration file- /etc/samba/smb.conf
Service-  smbd><nmbd

 

# yum install smaba -y                    (Install SAMBA Package)
# mkdir /data                                  (Create  directory)
# chmod 777 /data                           (Change Directory Permision)
# vim /etc/smba/smb.conf                (Open Configuration file)
 

hosts allow = 127.  192.168.0.  192.168.1.   (uncomment it line no 80)

write this end of this file.......

 [public]
        comment = hi this for windows
        path = /data
        public = yes
        writable = yes
        printable = yes
        browseable=yes
        valid user= ashu
 

# chcon -t samba_share_t /data
# adduser ashu
# passwd ashu
  redhat
  redhat


# getsebool -a | grep samba
samba_create_home_dirs --> off
samba_domain_controller --> off
samba_enable_home_dirs --> off
samba_export_all_ro --> off
samba_export_all_rw --> off
samba_run_unconfined --> off
samba_share_fusefs --> off
samba_share_nfs --> off
use_samba_home_dirs --> off
virt_use_samba --> off

# setsebool -P samba_enable_home_dirs on
# smbpasswd -a ashu
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 ashu.

#  /etc/init.d/smb restart;chkconfig smb on               (Restart Service)
#  testparm                                                                (Check config file)
Load smb config files from /etc/samba/smb.conf
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[public]"
Unknown parameter encountered: "valid user"
Ignoring unknown parameter "valid user"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
    workgroup = MYGROUP
    server string = Samba Server Version %v
    log file = /var/log/samba/log.%m
    max log size = 50
    hosts allow = 127., 192.168.0., 192.168.88.
    cups options = raw

[homes]
    comment = Home Directories
    read only = No
    browseable = No

[printers]

    comment = All Printers
    path = /var/spool/samba
    printable = Yes
    browseable = No

[public]
    comment = hi this for windows
    path = /data
    read only = No
    guest ok = Yes
    printable = Yes
 

# smbclient //192.168.88.129/data -U ashu                  (linux client side) 

password

Run  -   //192.168.88.129             (windows side client) 
user ashu
password ashu@123


Browser -

# firefox smb://192.168.88.129/data     (it will show the data)

 Mount for linux client-


# mount -t cifs -o user=ashu //192.168.88.129/data   /mnt
 

# vim /etc/fstab

//192.168.88.129/data /mnt    cifs    user=veer,pass=ashu@123        0 0
:wq
 

# mount -a
# mount


 

_____________________________________________________________________________________________
Click Back..                                Click Home..

https://docs.google.com/forms/d/1iNRZlJJO6rBFizzPcFmyOTEtfkdjhdVRmpM74IbiT3o/viewform