How To Install and Configure Samba Server and Client.

1. Install Samba in Centos / RHEL 

[root@Samba ~]# yum install samba samba-common samba-client 


2. Create Samba Shares Folder

[root@Samba ~]# mkdir  /Samba_Share

[root@Samba ~]# chmod -R 777 /Samba_Share


3. Configure Samba Share Path

[root@Samba ~]# cp /etc/samba/smb.conf /etc/samba/smb.conf.ORG

[root@Samba ~]# vim /etc/samba/smb.conf

change the Line:-  

workgroup = SAMBA to workgroup = WORKGROUP


Edit Below Lines in End of File.

[myShare]

        comment =  File Server Share For All

        path = /Samba_Share

        public = yes

        browsable =yes

        writable = yes

        read only = no

        create mask = 0644

        directory mask = 0755

        valid users = sambatest


4. To verify the configurations made, run the command:

[root@Samba ~]# testparm


5. Create User and Assign Password. 

[root@Samba ~]# useradd sambatest

[root@Samba ~]# smbpasswd -a sambatest

New SMB password:

Retype new SMB password:


6. Start And Enable Samba Service. 

[root@Samba ~]# systemctl start smb

[root@Samba ~]# systemctl enable smb

[root@Samba ~]# systemctl start nmb

[root@Samba ~]# systemctl enable nmb


7. Accessing Samba Share from Windows.

Go to the Window Machine and press the Windows logo key + R to launch the Run dialog 

and Type \\Samba_Server_IP

UserName: sambatest

Password: 



Create Samba Server Without Authentication  


[root@Samba ~]# cat /etc/samba/smb.conf

[global]

workgroup = WORKGROUP

        interfaces = lo ens192  192.168.122.xxx/24

        hosts allow = 127. 192.168.0. 10.1.0.

security = user

        map to guest = Bad User

passdb backend = tdbsam

printing = cups

printcap name = cups

load printers = yes

cups options = raw


[Share1]

        comment =  File Server Share For All

        path = /data/Share1

        guest ok = yes

        public = yes

        browsable =yes

        writable = yes

        read only = no

        create mask = 0644

        directory mask = 0755


[Share2]

    comment = File Server Share For All

    path = /data/Share2

    guest ok = yes

    public = yes

    browsable =yes

    writable = yes

    read only = no

    create mask = 0644

    directory mask = 0755


[root@Samba ~]# systemctl restart smb

Comments

Popular posts from this blog

PCS Corosync Pacemaker Cluster Mariadb using NFS

How to install and configure node js and PM2 in rhel7

How to Create or Configure iSCSI Server and Clinet