Samba

Samba's roles, its services, the structure of smb.conf and a share's settings, Samba accounts and Unix accounts, effective permissions, and the tools testparm, smbclient and smbstatus.

  • 25 cards
  • 4 topics
  • Free

The outline, topic by topic

Each topic is weighted the way the exam weighs it.

  1. Concepts
  2. Questions
  3. Sort and link
  4. Scenarios

A few cards from the deck

  • Samba: what is it?

    Show the answer

    A free software suite that implements SMB on Linux: file and print server, and domain member or controller.

    It is what lets a Linux server present itself as a Windows server to the network, and join an Active Directory domain.

  • Léa (compta group) tries to create a file in the share. What is the result?

    ```text
    [compta]
    path = /srv/compta
    read only = no
    valid users = @compta
    guest ok = no

    $ ls -ld /srv/compta
    drwxr-x--- 2 root compta 4096 May 10 10:00 /srv/compta
    `

    • Denied: the directory grants the compta group read access only
    • Accepted: read only = no is enough on its own to allow writing
    • Accepted: valid users gives group members every right on the files
    • Denied: a share without guest ok = yes is closed to every user
    Show the answer

    Denied: the directory grants the compta group read access only

    Effective permission is the more restrictive of the two levels. The share allows writing, but the directory is r-x for the group: Samba acts with Léa's Unix identity and the system refuses.

  • Samba runs … for files and printing, … for NetBIOS names and … to resolve a domain's accounts.

    Show the answer

    Samba runs smbd for files and printing, nmbd for NetBIOS names and winbindd to resolve a domain's accounts.

    smbd is the main daemon, on port 445. winbindd is used when Samba is a domain member, so the AD accounts are known to the system.

  • SMB: what is it?

    Show the answer

    The file and printer sharing protocol of Windows networks, which uses TCP port 445.

    Windows, macOS and Linux can all speak it: it is the common bridge for files.

  • smbclient answers "session setup failed: NT_STATUS_LOGON_FAILURE" for a user who exists on Linux and whose Linux password is correct. Probable cause and fix?

    • The share is not defined in smb.conf: add its section then reload Samba
    • Port 445 is closed on the server: open it in the local firewall
    • The user has no Samba password: create it with smbpasswd -a
    • The share's directory belongs to root: change its owner and permissions
    Show the answer

    The user has no Samba password: create it with smbpasswd -a

    Samba checks the password in its own database, separate from /etc/shadow. The server answered and refused the logon: neither the share name, nor the firewall, nor directory permissions are involved.