Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

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