1. What is Samba?
A) Samba is an open-source implementation of the SMB/CIFS protocol that allows file and printer sharing between Linux/Unix and Windows systems.
2. Which ports does Samba use?
A)
- 137/UDP → NetBIOS name service
- 138/UDP → NetBIOS datagram service
- 139/TCP → NetBIOS session service
- 445/TCP → Direct SMB over TCP
3. What is the main Samba configuration file?
A)
/etc/samba/smb.conf
4. What command tests Samba configuration?
A)
testparm
5. How do you start and enable the Samba service?
A)
systemctl start smb nmb
systemctl enable smb nmb
6.How do you create a Samba user?
A)
useradd smbuser
smbpasswd -a smbuser
7. How do you list available Samba shares on a server?
A)
smbclient -L //<server_ip>
8. How do you mount a Samba share in Linux?
A)
mount -t cifs //<server_ip>/share /mnt -o username=user,password=pass
9. What is the difference between [global], [homes], and [printers] sections in smb.conf?
A)
- [global]: General server-wide settings.
- [homes]: Auto-share user home directories.
- [printers]: Share printers.
10. How do you make Samba start automatically after reboot?
A)
systemctl enable smb nmb
11. What is the difference between SMB and CIFS?
A)
- SMB: Original protocol for Windows file sharing.
- CIFS: Common Internet File System, a dialect of SMB (SMB 1.0).
12. What are common Samba security modes?
A)
- user: Users authenticate with username/password.
- share: No per-user authentication (deprecated).
- domain/ads: Authentication via Windows Domain Controller/Active Directory.
13. What is the difference between smb and nmb daemons?
A)
- smbd: Handles file and print services.
- nmbd: Handles NetBIOS name resolution and browsing.
14. User cannot access Samba share. What do you check?
A)
- Samba service running (systemctl status smb).
- Firewall allows ports 137–139, 445.
- Samba user exists and password is set.
- File system permissions (Linux + Samba).
- Logs: /var/log/samba/log.smbd.
15. Samba share is accessible but user cannot write files. What do you check?
A)
- Linux directory permissions (chmod, chown).
- writeable = yes in smb.conf.
- SELinux contexts (setsebool -P samba_enable_home_dirs on).
16. How do you troubleshoot Samba connectivity from Windows?
A)
Test with \\<server_ip>\share.
Use net use command.
Check event logs on Windows and Samba logs on Linux.
17. What is the difference between Samba and NFS?
A)
Samba: Used for Linux ↔ Windows file/printer sharing (SMB/CIFS).
NFS: Used mainly for Linux ↔ Linux sharing.
18. What are alternatives to Samba?
A)
NFS (Linux-only).
FTP/SFTP.
Rsync over SSH.
WebDAV.