Courseiva
File Sharing and SambamediumMultiple ChoiceObjective-mapped

LPIC-2 File Sharing and Samba Practice Question

A company runs Samba on a Linux server to provide file shares to Windows clients. The server is also a BIND DNS server. After a recent OS upgrade, the Samba service fails to start with the error: 'Failed to create a listening socket for port 445: Permission denied'. The administrator checks that no other service is using port 445. smbd is configured to start as root. What is the most likely cause?

⚠ Common exam trap

Many candidates assume a 'Permission denied' error on a port must be caused by a firewall or another service already binding the port, overlooking SELinux's mandatory access control which can deny the bind even when the port is free and the process runs as root.

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

SELinux is blocking the Samba port.

SELinux, when enforcing, can block Samba from binding to privileged ports like 445 even when the service runs as root. The error 'Permission denied' on port 445, despite no other service using it and the firewall being open, strongly indicates SELinux is denying the bind. The SELinux boolean 'samba_port_t' or the specific port context must be enabled or relabeled for Samba to bind to port 445.

Answer analysis

Option-by-option breakdown

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

  • The firewall is blocking the port even though it's internal.

    Why it's wrong here

    Firewall rules do not produce a socket 'Permission denied' error; they drop packets.

  • The 'socket address' parameter is set to an invalid IP.

    Why it's wrong here

    This would cause 'cannot assign requested address', not permission denied.

  • SELinux is blocking the Samba port.

    Why this is correct

    SELinux policies may prevent binding to port 445; check with 'sealert' or disable SELinux to test.

  • The Samba netbios name is too long.

    Why it's wrong here

    Netbios name length does not affect socket creation.

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.