nerdexam
Linux_Foundation

LFCS · Question #332

In order to restrict access to the SMB (445/tcp) port and stop the use of NetBIOS (139/tcp), what parameter is required in smb.conf in Samba 3?

The correct answer is B. smb port = 445. To restrict Samba's listening ports to only SMB (445/tcp) and prevent NetBIOS over TCP/IP (139/tcp), the smb port parameter in smb.conf should be used.

Submitted by kwame.gh· Apr 18, 2026Service Configuration

Question

In order to restrict access to the SMB (445/tcp) port and stop the use of NetBIOS (139/tcp), what parameter is required in smb.conf in Samba 3?

Options

  • Adisable netbios = Yes
  • Bsmb port = 445
  • Cdisable directhosting = No
  • Dsocket options = port:445

How the community answered

(24 responses)
  • B
    92% (22)
  • C
    4% (1)
  • D
    4% (1)

Why each option

To restrict Samba's listening ports to only SMB (445/tcp) and prevent NetBIOS over TCP/IP (139/tcp), the `smb port` parameter in `smb.conf` should be used.

Adisable netbios = Yes

The `disable netbios` parameter is not a standard or recognized configuration directive in Samba for controlling port usage.

Bsmb port = 445Correct

Setting `smb port = 445` in `smb.conf` configures Samba to listen exclusively on port 445 for SMB traffic. This effectively disables the legacy NetBIOS session service on port 139, restricting access to modern direct SMB over TCP.

Cdisable directhosting = No

`disable directhosting` is not a valid Samba parameter for port control; 'direct hosting' refers to SMB over TCP, and this parameter would incorrectly suggest disabling it.

Dsocket options = port:445

The `socket options` parameter is used for setting low-level TCP socket options, not for specifying the listening port, and `port:445` is not a valid syntax for this parameter.

Concept tested: Samba port configuration and NetBIOS disablement

Source: https://www.samba.org/samba/docs/current/manpages/smb.conf.5.html

Topics

#Samba#smb.conf#Network Ports#Service Configuration

Community Discussion

No community discussion yet for this question.

Full LFCS Practice