Project Samba

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 54

SAMBA

SAMBA
SAMBA allows the networking between

Windows and Linux/UNIX operating systems.


Samba enables sharing file systems and
printers on a network with computers that
use the Server Message Block (SMB) or
Common Internet File System (CIFS)
protocols.
SMB is the Microsoft protocol that is
delivered with Windows operating systems
for sharing files and printers.

SAMBA

Linux
Linux Server
Server

Windows
Windows Client
Client

Linux
Linux Client
Client

Windows
Windows Server
Server

Installing samba packages

To install the samba package using yum


[root@server4 ~]# yum install samba -y
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package samba.i686 0:3.6.9-168.el6_5 will be installed
--> Processing Dependency: samba-winbind-clients = 3.6.9168.el6_5 for package: samba-3.6.9-168.el6_5.i686
--> Processing Dependency: samba-common = 3.6.9-168.el6_5 for
package: samba-3.6.9-168.el6_5.i686
--> Running transaction check
---> Package samba-common.i686 0:3.6.9-164.el6 will be updated
--> Processing Dependency: samba-common = 3.6.9-164.el6 for
package: samba-client-3.6.9-164.el6.i686

Installing samba packages


[root@server4 ~]# rpm -qa | grep
samba
samba4-libs-4.0.0-58.el6.rc4.i686
samba-common-3.6.9-168.el6_5.i686
samba-winbind-clients-3.6.9-168.el6_5.i686
samba-client-3.6.9-168.el6_5.i686
samba-3.6.9-168.el6_5.i686
samba-winbind-3.6.9-168.el6_5.i686

Installing samba packages

To install the samba package using rpm


[root@Server3 ~]# rpm -qa | grep samba
samba4-libs-4.0.0-58.el6.rc4.i686
samba-client-3.6.9-164.el6.i686
samba-winbind-clients-3.6.9-164.el6.i686
samba-common-3.6.9-164.el6.i686
samba-winbind-3.6.9-164.el6.i686
[root@Server3 Packages]# rpm -ivh samba-3.6.9-164.el6.i686.rpm
warning: samba-3.6.9-164.el6.i686.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de:
NOKEY
Preparing...
########################################### [100%]
1:samba
########################################### [100%]

[root@Server3 Packages]#

Installing samba packages


[root@Server3 Packages]# rpm -qa | grep
samba
samba4-libs-4.0.0-58.el6.rc4.i686
samba-client-3.6.9-164.el6.i686
samba-winbind-clients-3.6.9-164.el6.i686
samba-common-3.6.9-164.el6.i686
samba-3.6.9-164.el6.i686
samba-winbind-3.6.9-164.el6.i686
[root@Server3 Packages]#

Running the SAMBA service


To check whether the SAMBA service is running:

[root@Server3 ~]# service smb status


smbd is stopped
To run SAMBA service
[root@Server3 ~]# service smb start
Starting SMB services:
To stop the running SAMBA service
[root@Server3 ~]# service smb stop
Shutting down SMB services:
To restart the SAMBA service
[root@Server3 ~]# service smb restart
Shutting down SMB services:
Starting SMB services:

[ OK ]

[ OK ]

[ OK ]
[ OK ]

Running the SAMBA service


If you want the service to start automatically at

the boot time, use the following command:


# chkconfig smb on
To prevent the service from starting

automatically at the boot time, type:


# chkconfig smb of
Alternatively, you can use the Service
Configuration
Utility (GUI ) or the ntsysv utility (TUI).

Configure the Firewall


Configure the Firewall to trust Samba and Samba
Client services

Disable SELinux

To disable SELinux for all services:


[root@Server3 ~]# vi
/etc/sysconfig/selinux
selinux=disabled

Or you can use the SELinux


Management to disable SELinux for

SAMBA

Configure SELinux Management

In Fedora SELinux Management is installed


by default

Configure SELinux Management


In CentOS you need to installing

SELinux Management
# yum -y install policycoreutils-python
Or
use rpm ivh to install the following
packages:
1.

audit-libs-python-2.2-2.el6.i686.rpm

2.

libcgroup-0.40.rc1-5.el6.i686.rpm

3.

libsemanage-python-2.0.43-4.2.el6.i686.rpm

4.

setools-libs-3.3.7-4.el6.i686.rpm

5.

setools-libs-python-3.3.7-4.el6.i686.rpm

6.

policycoreutils-python-2.0.83-19.39.el6.i686.rpm

7.

gtkhtml2-2.11.1-7.el6.i686.rpm

8.

gnome-python2-gtkhtml2-2.25.3-20.el6.i686.rpm

9.

setools-console-3.3.7-4.el6.i686.rpm

Configure SELinux Management

Configure SELinux Management

Accessing Linux share from a Windows


system

/etc/samba/smb.conf

is the SAMBA main file


configuration
Before editing the smb.conf
file , it is a good idea to keep a
copy of the default one.
[root@server1 ~]# cd /etc/samba/
[root@server1 samba]# cp smb.conf
smb.conf.default

SAMBA as a Domain Member File server

SAMBA as a Domain Member File server


Create DNS entry for Linux server on

Windows DNS

SAMBA as a Domain Member File server


[root@server1 ~]# mkdir /LinuxDomainShare
[root@server1 ~]# chmod -R 1777
/LinuxDomainShare

[root@server1 ~]# vi /etc/samba/smb.conf


.
[LinuxDomainShare]
comment = Linux Domain Share
path = /LinuxDomainShare
public = yes
writable = yes

SAMBA as a Domain Member File server

Editing the /etc/krb5.conf file

To connect to a Windows Domain you will need


to adjust the kerberos realm in /etc/krb5.conf
and set both lookup statements to true.
The Kerberos authentication protocol provides a mechanism
for authentication between a client and a server, or between
one server and another server.

#vi /etc/krb5.conf
[libdefaults]
default_realm = ABC.LOC
dns_lookup_realm = true
dns_lookup_kdc = true

(capital letters)

SAMBA as a Domain Member File server


Joining the Linux server to the Active
Directory domain
[root@server4 ~]# authconfig-tui

SAMBA as a Domain Member File server

SAMBA as a Domain Member File server

SAMBA as a Domain Member File server

SAMBA as a Domain Member

SAMBA as a Domain Member File


server

Verify in Active Directory Users and Computers that a


computer account is created for the samba server.

SAMBA as a Domain Member File


server
[root@server4 ~]# service smb restart
Shutting down SMB services:
Starting SMB services:

[ OK ]
[ OK ]

[root@server4 ~]# service winbind restart


Shutting down Winbind services:
Starting Winbind services:
]
[root@server4 ~]#

[ OK ]
[ OK

SAMBA as a Domain Member File


server
Verify the trust between your samba server

and Active Directory


[root@server4 ~]# wbinfo -t
checking the trust secret for domain ABC via
RPC calls succeeded
[root@server4 ~]#

SAMBA as a Domain Member

List all Domain users

[root@server4 ~]# wbinfo -u


administrator
guest
eng1
user1
krbtgt
sale1
admin
[root@server4 ~]#

SAMBA as a Domain Member File


server
List all Domain groups

[root@server4 ~]# wbinfo -g


winrmremotewmiusers__
dhcp users
dhcp administrators
engineers
group1
domain computers
domain controllers
schema admins
enterprise admins

SAMBA as a Domain Member File


server

Query a user

[root@server4 ~]# wbinfo -a admin


%P@ssword
plaintext password authentication succeeded
challenge/response password authentication
succeeded
[root@server4 ~]#reboot

SAMBA as a Domain Member File server

SAMBA as a Domain Member File server

SAMBA as a Domain Member File server

SAMBA as a Domain Member File server

SAMBA as a Domain Member Print Server

SAMBA as a Domain Member Print


Server

Adding and sharing printer

SAMBA as a Domain Member Print


Server

SAMBA as a Domain Member Print


Server

SAMBA as a Domain Member Print


Server

SAMBA as a Domain Member Print


Server

SAMBA as a Domain Member Print


Server

SAMBA as a Domain Member Print


Server

SAMBA as a Domain Member Print


Server

SAMBA as a Domain Member Print


Server

SAMBA as a Domain Member Print Server

[root@server1 ~]# vi /etc/samba/smb.conf


.
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes

SAMBA as a Domain Member Print


Server
[root@server4 ~]# service smb restart
Shutting down SMB services:
Starting SMB services:

[ OK ]
[ OK ]

[root@server4 ~]# service winbind restart


Shutting down Winbind services:
Starting Winbind services:
]
[root@server4 ~]#

[ OK ]
[ OK

SAMBA as a Domain Member Print


Server

SAMBA as a Domain Member Print Server

SAMBA as a Domain Member Print Server

SAMBA as a Domain Member Print Server

SAMBA as a Domain Member Print Server

SAMBA as a Domain Member Print Server

SAMBA as a Domain Member Print Server

You might also like