Courseiva
File Sharing and SambamediumMultiple ChoiceObjective-mapped

LPIC-2 File Sharing and Samba Practice Question

An administrator wants to restrict access to a Samba share based on client IP addresses. Which parameter in the [share] section of smb.conf should be used?

⚠ Common exam trap

Many candidates confuse the parameter order (`allow hosts` vs `hosts allow`) or mistakenly think `valid users` can filter by IP, when it only filters by authenticated user identity.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

hosts allow

The `hosts allow` parameter in the `[share]` section of `smb.conf` restricts access to the Samba share based on client IP addresses or subnets. It is the correct directive for IP-based access control, allowing the administrator to specify which hosts are permitted to connect. This parameter is evaluated before authentication, blocking unauthorized IPs at the connection level.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • hosts allow

    Why this is correct

    'hosts allow' defines IP-based access control per share.

  • allow hosts

    Why it's wrong here

    'allow hosts' is an alias for 'hosts allow', but the standard parameter is 'hosts allow'.

  • browseable

    Why it's wrong here

    'browseable' controls visibility in the network, not IP-based restriction.

  • valid users

    Why it's wrong here

    'valid users' controls user-level access, not IP addresses.

Visual reference

192.168.1.0 /24 256 addresses (254 usable) 192.168.1.0 /25 Subnet A 128 addr (126 usable) 192.168.1.128 /25 Subnet B 128 addr (126 usable) Borrowing 1 bit from host portion creates 2 subnets (/25)

About these practice questions

This LPIC-2 question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LPIC-2 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-2 exam.