LPIC-2 202-450 study materials
LPIC-2 202-450 study resources

LPIC-2 202-450: File Sharing

LPIC-2 202-450 · Work through your exam, one topic at a time.

All guide sections

File Sharing

File Sharing tests Samba and NFS: exporting directories, mapping identities, controlling access, and mounting from clients. The exam favors working configuration over broad theory.

Core rules

  • Samba global settings in smb.conf include workgroup, security = user, and passdb backend = tdbsam. Shares set path, browseable, writable, valid users, write list, create mask, and directory mask.
  • Samba passwords are separate: smbpasswd -a alice or pdbedit -a -u alice; list with pdbedit -L. testparm checks syntax; reload smbd (and nmbd for browsing).
  • NFS exports live in /etc/exports: /srv/share 192.0.2.0/24(rw,sync,no_subtree_check). Apply with exportfs -ra; inspect with exportfs -v and showmount -e localhost. NFSv4 uses TCP/2049; NFSv3 also needs rpcbind/111 and mountd.
  • root_squash maps remote root to nobody; no_root_squash trusts it and is risky. sync is safer than async. Clients mount with mount -t nfs4 server:/srv/share /mnt or an /etc/fstab entry.

Worked example

Create a Samba share for group accounting at /srv/accounting. Run chgrp accounting /srv/accounting, chmod 2770 /srv/accounting; in smb.conf add [accounting] path = /srv/accounting, valid users = @accounting, writable = yes, create mask = 0660, directory mask = 2770. Add users with smbpasswd -a, run testparm, reload. Reasoning: the setgid bit keeps new files in the group; the masks prevent world access; valid users enforces group membership at Samba level, not just Unix mode bits.

Traps

NFS export options must have no spaces before the parenthesis; exportfs -ra is needed after edits; a firewall blocking 2049/111 breaks mounts. Samba may be blocked by SELinux (samba_share_t) or fail because the Unix user has no Samba password. root_squash surprises admins who expect root-owned uploads to remain root-owned.