Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

SAMBA

PhD. Alcides Montoya Canola, Est. Carlos Andres Ballesteros


Universidad Nacional de Colombia - sede Medellin

Abstract
This guide will develop the procedure that will allow you to practice
the knowledge acquired in the theoretical class of server management.
The topic to be developed is samba.

1 Introduction
Using Samba, a Unix machine can be configured as a file and print server for
macOS, Windows, and OS/2 machines. Samba has developed into a fully-
fledged and rather complex product. Configure Samba with YaST, or by editing
the configuration file manually. Samba server provides SMB/CIFS services and
NetBIOS over IP naming services to clients. For Linux, there are three daemons
for Samba server: smbd for SMB/CIFS services, nmbd for naming services, and
winbind for authentication.

Figure 1: SAMBA

1.1 SMB PROTOCOL


Samba uses the SMB (server message block) protocol that is based on the Net-
BIOS services. Microsoft released the protocol so other software manufacturers
could establish connections to a Microsoft domain network. With Samba, the
SMB protocol works on top of the TCP/IP protocol, so the TCP/IP protocol
must be installed on all clients. CIFS (common Internet file system) protocol is

1
another protocol supported by Samba. CIFS defines a standard remote file sys-
tem access protocol for use over the network, enabling groups of users to work
together and share documents across the network. NetBIOS is a software in-
terface (API) designed for communication between machines providing a name
service. It enables machines connected to the network to reserve names for them-
selves. After reservation, these machines can be addressed by name. There is
no central process that checks names. Any machine on the network can reserve
as many names as it wants as long as the names are not already in use. The
NetBIOS interface can be implemented for different network architectures. An
implementation that works relatively closely with network hardware is called
NetBEUI, but this is often called NetBIOS. Network protocols implemented
with NetBIOS are IPX from Novell (NetBIOS via TCP/IP) and TCP/IP.

SMB servers provide resources to the clients by means of shares. Shares are
printers and directories with their subdirectories on the server. It is exported
by means of a name and can be accessed by its name. The share name can be
set to any name—it does not need to be the name of the export directory. A
printer is also assigned a name. Clients can access the printer by its name.

Figure 2: How does SMB [2]

1.2 NetBIOS
NetBIOS is a software interface (API) designed for communication between ma-
chines providing a name service. It enables machines connected to the network
to reserve names for themselves. After reservation, these machines can be ad-
dressed by name. There is no central process that checks names. Any machine
on the network can reserve as many names as it wants as long as the names
are not already in use. The NetBIOS interface can be implemented for different
network architectures. An implementation that works relatively closely with
network hardware is called NetBEUI, but this is often called NetBIOS. Net-
work protocols implemented with NetBIOS are IPX from Novell (NetBIOS via
TCP/IP) and TCP/IP.
The NetBIOS names sent via TCP/IP have nothing in common with the
names used in /etc/hosts or those defined by DNS. NetBIOS uses its own, com-
pletely independent naming convention. However, it is recommended to use

2
names that correspond to DNS host names to make administration easier or use
DNS natively. This is the default used by Samba.[1].

2 Development of Practice
The development of the practice will take place in the distribution of Open Suse
Leap 15, it is clear that this practice can be extended to other distributions
taking into account their respective changes.

2.1 Necessary logical equipment.


we must install the samba server, if it is already installed, we must update it,
for this, we write the following commands in the console.

Execute the following to install the service:

2.2 Start service and add the service to the system boot.
SAMBA is a service that must be enabled once it has been configured. And it
must be restarted when a new configuration has been made, for it to execute
the following commands.

Execute the following to enable the service:

Execute the following to restart the service:

2.2.1 Necessary modifications in the firewall.


Clients on all subnets must be able to communicate with the server. To define
the interfaces that the samba server should listen to, adjust the firewall accord-
ingly, for this we execute the following commands.

Execute the following to configure the firewall:

3
Run the following to reload the firewall:

2.2.2 Files and configuration directories.


• /etc/samba/smb.conf The configuration allows users to view their home
directories as a Samba share (Samba share). We also have all the printers
configured for the system as Samba shared printers. In other words, for
example, you can connect a printer to the system and print to it from the
Windows machines on your network.

In case you have modified /etc/samba/smb.conf while the NFS


server was running, you need to restart it for the changes to become
active.

create a folder in the directory / with the name sambashare, also assign all
the permissions. This folder will be the one we will share with all the computers
in our network.

To export a directory to computers windows or Mac OS, add the following


in the document:

4
2.2.3 Access Control Options
As we have seen in the previous example, the access permissions are indented,
there are many more permissions as shown in table 1, for more information visit
Samba.org

Option parameters Function


Admin Users String Users who can perform operations as root
Valid Users String Users who can connect to a share
Invalid Users String Users who will be denied access to a share
read list String Users who have read-only access to a writable share
write list String Users who have read/write access to a read-only share
write list String Users who have read/write access to a read-only share
guest only boolean If yes, allows only guest access

Table 1: Access Control Options [2]

2.3 The client side


for windows, configure the network and press Windows + r you will get a win-
dow as in figure 3, type the ip of the samba server and the path of the file you
want to open.

Figure 3: Windows + r [2]

3 Exercise
Install and configure the SAMBA server, as shown throughout the development
of the practice, mount a network of computers with linux and Windows software
and test it.

5
∗ Challenge
Install the cups-pdf printer, configure the printing service (CUPS) and
offer the service for Windows and Mac OS computers, and share the printer
through Samba.

References
[1] SAMBA/openSUSE Leap 15.0”, doc.opensuse.org 2018

[2] Samba/docs”, www.samba.org 2018

You might also like