Skip to main content

Samba configuration on linux server

 


Samba configuration on Linux Server: (without password samba sare)


• Samba is the Linux tool or utility that allows sharing of the Linux resources such as files and printers with other operating system.


• It works exactly like NFS but the difference is NFS shares within linux or Unix like system whereas Samba shares with other OS. (Windows,MAC).


For Example: computer A shares its filesystem with computer B using samba then computer B will see the shared filesystem as if it is mounted as the local filesystem.


• samba shares its filesystem through a protocol called SMB. (server message Block) which was invented by IBM.


• Another protocol used to share the samba is through CIFS(common Internet File system) invented by Microsoft and NMB.


• Steps of the samba configuration:


> Take the snapshot of VM.


Alway take the snapshot before any configuration, because if anything goes wrong we can revert to the snapshot.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


> Install samba packages.

#yum install samba samba-client samba-common

also after the packages installation, run the following command to make sure the packages are installed.

#rpm -qa | grep samba



>>>>>>>>>>>>>>>>>>>>>>>>>>>>


>Enable samba to be allowed through firewall.

#firewall-cmd  --permanent  --zone=public  --add-service = samba

#firewall-cmd   -reload


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

> or Disable firewall

#systemctl stop firewalld

#systemctl disable firewalld


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

> create the samba share directory and assign permissions.

#mkdir -p  /samba/morepretzels

#chmod  a+rwx  /samba/morepretzels

#chown  -R  nobody:nobody  /samba

#chown  -R  nobody:nobody   /samba/morepretzels/


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>Also change the SElinux security context for the samba shared directory.

#sestatus: shows the status of selinux

#chcon  -t  samba_share_t  /samba.morepretzels



>>>>>>>>>>>>>>>≥>>>>>>>>>>>>>>>>



> or disable SElinux.

#sestatus

#vi /etc/selinux/config


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


change

SELINUX=enforcing 

to

SELINUX=disabled


#reboot

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

> modify /etc/samba/smb.conf file to add new shared filesystem.


#cp-p/etc/samba/smb.conf /etc/samba/smb.conf_bkp


#vi  /etc/samba/smb.conf



Write the below content in smb.conf file:


[global]

workgroup =WORKGROUP

netbios name = centos

security = user

map to guest = bad user

dns proxy = no



[Anonymous]

path = /samba/morepretzels

browsable = yes

writable = yes

guest ok = yes

guest only = yes

read only = no


>>>>>>>>>>>>>>>>>>>>>>>>>>>>


>verify the settings.

#testparm



> once the packages are installed, enable and start Samba services.

#systemctl enable smb

#systemctl enable nmb

#systemctl start smb

#systemctl start nmb

#systemctl status smb

#systemctl status nmb


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


> Mount samba share on the windows client

Go to start

Go to search bar

type  \\ip of linux machine where samba is configured


>>>>>>≥>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>mount samba share on linux client.

#yum -y install cifs-utils samba-client


create the mount point directory

#mkdir  /mnt/sambashare


mount the samba share

#mount  -t  cifs  //192.168.1.18/Anonymous /mnt/sambashare


Comments

Popular posts from this blog

patching tasks

 Patching a Linux system is a critical task to ensure that the system remains secure, stable, and up-to-date with the latest features and fixes. Here’s a comprehensive guide to the tasks involved in Linux patching: 1. Pre-Patching Preparation Backup System : Ensure you have a full system backup, including critical data, configuration files, and applications. Test the backup to verify its integrity. Check Disk Space : Verify that you have enough disk space, particularly on /var , /tmp , and /boot partitions. Review Current Patch Level : Determine the current patch level and installed packages using package management tools like yum , apt , dpkg , or rpm . Check System Logs : Review system logs to identify any issues that might affect the patching process. Test in a Staging Environment : If possible, apply patches in a staging environment that mirrors production to identify potential issues. Notify Stakeholders : Inform stakeholders about the scheduled maintenance window and expecte...

Associate cloud Engineer notes

 google cloud offers below services:  compute  storage big data  machine learning  application services at the end of this notes you will be able to :  identify the value of the google cloud products  use application deployment environment on google cloud use google storage options  interact with google cloud service describe the ways in which customers use google cloud .   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>. TOPICS:  cloud computing  IAAS ,PAAS,SAAS pricing and billing google cloud hierarchy  IAM VPC  compute engine scaling virtual machines through load balancer cloud DNS and CDN  google cloud storage options  storage classes and data transfer  cloud SQL  cloud spanner  Firestore Bigtable  comparing storage optio...