← Back to quizzesFree quiz

Samba, backups i RAID en entorns Linux

In this course we explore three fundamental topics for Linux system administrators: configuring Samba shares, creating efficient backups with rsync , and designing reliable storage using…

10 questions~5 min
Samba, backups i RAID en entorns Linux — Qwi
0 / 10
Score: 0%
1

Quin nivell de seguretat de Samba requereix autenticació d'usuari per a cada recurs compartit?

2

En una configuració Samba, quin paràmetre controla si un recurs és visible en la llista de recursos del servidor?

3

Quina opció de l'opció '--exclude' de rsync permet excloure tots els fitxers amb extensió .txt?

4

En un RAID 5, quants discs mínims són necessaris per garantir la redundància de dades?

5

Quin paràmetre de la secció [global] de smb.conf defineix el mode de compartició de recursos?

6

Si es vol permetre l'accés com a convidat només a un recurs específic, quins dos paràmetres s'han d'incloure a la secció corresponent?

7

Quin tipus de còpia de seguretat es considera una variant incremental perquè només copia fitxers modificats des de l'última execució?

8

En un entorn de cluster d'alta disponibilitat, quina característica principal permet que el sistema continuï operatiu quan falla un node?

9

Quin paràmetre de smb.conf determina si un usuari amb contrasenya incorrecta serà tractat com a convidat?

10

En una còpia de seguretat incremental (nivell 2), quina és la condició per a que un fitxer sigui inclòs en la nova còpia?

Samba, Backups and RAID in Linux Environments

In this course we explore three fundamental topics for Linux system administrators: configuring Samba shares, creating efficient backups with rsync, and designing reliable storage using RAID. Each section explains the key concepts, provides practical examples, and highlights best practices for security and performance. The material is organized to match the quiz questions, ensuring you can directly apply what you learn to real‑world scenarios.

1. Understanding Samba Security Levels

Samba implements the SMB/CIFS protocol, allowing Windows and Linux clients to share files and printers. Security is controlled by the security parameter in the [global] section of smb.conf. The most common setting is user level, which requires each client to authenticate with a valid username and password on the server.

  • User‑level security – The server validates credentials against its own user database (or via PAM/LDAP). This is the default and safest option for most environments.
  • Server‑level security – Delegates authentication to another server; rarely used in modern setups.
  • Domain‑level security – Integrates with a Windows domain controller; useful in mixed Windows‑Linux networks.
  • Share‑level security – Assigns a password per share; considered insecure and is deprecated.

When security = user is set, every access request triggers an authentication step, protecting each shared resource from unauthorized use.

2. Controlling Share Visibility with the browseable Parameter

Even after authentication, administrators may want to hide certain shares from the list that appears when a client browses the server. The browseable (or browseable = yes/no) option determines whether a share is displayed in the network neighborhood.

  • browseable = yes – The share appears in the list of available resources.
  • browseable = no – The share is hidden; users must know the exact path to connect.

Hiding a share is useful for administrative directories, backup locations, or any resource that should not be advertised publicly.

3. Guest Access: guest ok and only guest

Sometimes a share must be accessible without credentials, but only for a specific directory. To achieve this, two parameters are combined in the share definition:

[public]
    path = /srv/samba/public
    guest ok = yes
    only guest = yes

These settings allow anonymous users to read/write (depending on other permissions) while preventing authenticated users from accessing the share unless they explicitly log in as a guest.

4. Using rsync for Precise File Exclusions

rsync is the go‑to tool for incremental backups and file synchronization. Its --exclude option accepts shell‑style patterns to omit files from the transfer. To exclude all .txt files, the correct syntax is:

rsync -av --exclude='*.txt' /source/ /destination/

The pattern *.txt matches any filename ending with .txt, regardless of directory depth. Multiple --exclude flags can be combined to filter out various file types.

5. RAID 5: Minimum Disk Requirements and Redundancy

RAID (Redundant Array of Independent Disks) provides fault tolerance and performance improvements. RAID 5 distributes data and parity across all disks, allowing the array to survive a single disk failure without data loss.

  • Minimum disks required: Three drives. With three disks, the array can store data on two disks while using the third for parity.
  • Adding more disks increases capacity and read performance, but write performance is limited by parity calculations.
  • If a disk fails, the array reconstructs the missing data on the fly using the remaining disks and parity information.

Understanding the minimum requirement helps you design cost‑effective, resilient storage solutions.

6. Backup Strategies: Incremental vs. Differential

Backup types differ in how they handle changed data:

  • Full backup (level 0) – Copies every file; the baseline for all other backups.
  • Incremental backup (level 2) – Copies only files changed since the last backup of any type. This is the most storage‑efficient method but requires the full backup and every incremental set for a restore.
  • Differential backup (level 1) – Copies files changed since the last full backup. Faster restores than incremental, but uses more space.

When the quiz mentions a "variant incremental" that copies files modified since the last execution, it refers to the rsync backup approach, which behaves like an incremental backup by default (using timestamps and checksums).

7. High‑Availability Clusters: Redundancy of Servers

In a high‑availability (HA) cluster, the primary goal is to keep services running despite hardware or software failures. The key characteristic that enables this continuity is redundancy of servers. By having at least two nodes that can host the same services, the cluster can automatically fail over to a standby node when the active node crashes.

  • Redundancy is often combined with shared storage (e.g., DRBD, NFS) and a quorum mechanism to avoid split‑brain scenarios.
  • Other cluster features—load balancing, low latency networking, and horizontal scalability—enhance performance but are not the primary reason for continuity.

8. Putting It All Together: A Sample Samba Configuration

Below is a concise example that incorporates the concepts discussed:

# /etc/samba/smb.conf
[global]
   workgroup = WORKGROUP
   security = user          # user‑level authentication
   map to guest = Bad User  # map unknown users to guest

# Public share – guest‑only access
[public]
   path = /srv/samba/public
   browseable = yes
   read only = no
   guest ok = yes
   only guest = yes

# Private share – requires authentication
[private]
   path = /srv/samba/private
   browseable = yes
   read only = no
   valid users = @smbusers
   guest ok = no

This configuration demonstrates:

  • Setting security = user for per‑user authentication.
  • Using browseable to control visibility.
  • Enabling a guest‑only share with guest ok and only guest.
  • Restricting a private share to a specific user group.

9. Best Practices and SEO Tips for Documentation

When writing technical documentation or blog posts about Samba, backups, or RAID, keep these SEO guidelines in mind:

  • Use clear, keyword‑rich headings (e.g., "Samba user‑level security", "RAID 5 minimum disks"). Search engines prioritize <h2> and <h3> tags.
  • Include code blocks and configuration snippets using <pre> and <code> tags; they improve readability and increase dwell time.
  • Write concise meta descriptions (150‑160 characters) that summarize each section’s value.
  • Link to authoritative sources (e.g., the official Samba documentation) to boost credibility.
  • Use semantic HTML (lists, paragraphs, emphasis) to help crawlers understand the page structure.

Applying these practices ensures your content ranks well and serves the community effectively.

10. Quick Review Quiz

Test your knowledge with the following questions (answers are provided for self‑assessment):

  1. Which Samba security level requires user authentication for each shared resource?
    Answer: user‑level
  2. Which parameter controls whether a share appears in the server’s resource list?
    Answer: browseable
  3. How do you exclude all .txt files with rsync?
    Answer: --exclude='*.txt'
  4. What is the minimum number of disks needed for RAID 5 redundancy?
    Answer: Three disks
  5. Which smb.conf global parameter defines the sharing mode?
    Answer: security
  6. To allow guest access only on a specific share, which two parameters must be set?
    Answer: guest ok and only guest
  7. Which backup type is a variant of incremental that copies only modified files since the last run?
    Answer: Rsync backup
  8. In a high‑availability cluster, what main feature keeps the system operational after a node failure?
    Answer: Redundancy of servers

Review each answer and revisit the relevant sections if you need clarification.