Tanti Technology

My photo
Bangalore, karnataka, India
Sandeep Kumar | Founder, Tanti Technologies At Tanti Technologies, I share practical knowledge, hands-on tutorials, and real-world solutions across Python, SQL, Docker, Kubernetes, CI/CD, AWS, Azure, Machine Learning, Generative AI, and Agentic AI. My mission is to simplify complex technologies and provide actionable insights that help developers, engineers, and businesses learn faster, build better, automate smarter, and innovate with confidence. 🚀 Learn • Build • Automate • Innovate Follow Tanti Technologies for practical technology insights and next-generation AI solutions.

Monday, 28 August 2017

SAMBA Server Configuration in Linux (Redhat or CentOS 6)



SAMBA SERVER


    The samba server will provide user authentication via passwords and optionally domains. Samba can also try AFS(andrew file system) authentication, granting AFS rights if successfull or falling back to native password checking otherwise.

        Samba also has the ability through the winbindd daemon, to attach to a microsoft daemon password server.
        When a redhat linux is running  the winbindd service user accounts defined in the microsoft domain can be used to authenticate to the redhat linux machine.
Additionally in samba version 3.0 and later the samba services can use some microsoft active directory resources.

SAMBA SERVICES:
    Four main services of samba
1)Authentication and authorization of users
2)File and printer sharing
 
3)Name resolution
 
4)Browsing(service announcements)

Related:
    smbclient command line access
linux can mount a samba share using cifs and smbfs filesystem
 
    File and printer sharing is probably the most attractive samba feature for most users. With this functions users can easily retrive files or print to any printer over the network.


SERVICE PROFILE:
Type: System V-managed service
Packages: Samba,samba-common,samba-client
Daemons: /usr/sbin/nmbd,/usr/sbin/smbd
Script: /etc/init.d/smb
Ports: 137(-ns),138(-dgm),139(-ssh), 445(-ds)
Configuration file: /etc/samba/smb.conf
Related: system-config-samba,testparm

Steps to configure samba server:
#yum install samba-* -y
#service smb start
 
#chkconfig smb on
#vi /etc/samba/smb.conf
copy last 8 lines and paste under change as follows
[linux]
comment=
path=/exam(directory to be shared)
valid users=sam john
writable= yes
printable= no
hosts allow= 192.168.0.(allowable network)

here we are sharing /exam directory to sam and john they can read write /exam from any of 192.168.0. network system by using a share name linux
Note: we have to provide samba password for both users
 
#smbpasswd -a
samba passwords will store under /etc/samba/smbpasswd
To check syntax of configuration file:
#testparm
#service smb restart
#mkdir /exam
#chmod 777 /exam
(here we have to set selinux context )
#chcon -t samba_share_t /exam
#setsebool -P allow_smbd_anon_write=1



FROM LINUX CLIENT:
Note: Client must have samba-client package
 
#yum install samba-* -y
#service smb start
#service smb restart
#smbclient /// -U

try to get and put

to disconnect
 
smb> (type exit)


from windows client
 
Ist method :
 
right click on mynetwork places--- select mapnetwork drive--- choose a drive
in folderbox type \\\sharename
select finish
type username and password
 
try to create some files and folders

to disconnect 

rightclick on mynetwork places disconnect network drive
 
select drive click ok


IInd Method

start---run ----
\\\
provide username and password

to access user homedirectory
#setsebool -P samba_enable_home_dirs 1

from linux client

#smbclient /// -U

from windows client
start--run--\\\
provide username & password


to give directory for a specific group

vi /etc/samba/smb.conf
[]
path=
write list=@

ex:
[linux]
path=/exam
write list=@sales

No comments:

Post a Comment