student@ubuntu:~$
ncae 3/5 35 XP

SMB Triage

0%

Quick Reference

Samba Commands

Command What It Does
smbclient -L //server List all shares on a server
smbclient //server/share -U user Connect to a share interactively
smbclient -L //server -N List shares anonymously (no password)
testparm Validate smb.conf and show effective config
testparm -s Validate silently (suppress the “press enter” prompt)
smbpasswd -a username Add/change a Samba password for a Linux user
pdbedit -L List all Samba user accounts
systemctl status smbd Check if Samba daemon is running
systemctl restart smbd nmbd Restart both Samba daemons
smbstatus Show active connections, open files, and locks

smb.conf Directives

Directive Section What It Does
workgroup = MYGROUP [global] Sets the NetBIOS workgroup name
security = user [global] Requires username/password authentication
path = /srv/samba/docs [share] Directory this share maps to on disk
browseable = yes [share] Share appears in network browse list
read only = no [share] Allows write access (default is read-only)
valid users = @group [share] Only these users/groups can access
guest ok = yes [share] Allows anonymous access (use with caution)
force user = nobody [share] All file ops run as this user (never root)
create mask = 0660 [share] Permissions for newly created files
directory mask = 0770 [share] Permissions for newly created directories

Common Error Codes

Error Meaning First Thing to Check
errno 111 (Connection refused) Nothing listening on port 445 Is smbd running?
errno 113 (No route to host) Network can’t reach the server Ping the IP, check firewall
NT_STATUS_BAD_NETWORK_NAME Share exists in config but can’t be served Does the path exist on disk?
NT_STATUS_LOGON_FAILURE Wrong credentials smbpasswd -a user (Samba passwords are separate)
NT_STATUS_ACCESS_DENIED Authenticated but no permission Check valid users and Linux file permissions

Unlocks

Complete this skill to see what it unlocks.