Error Codes Wiki

Samba/SMB Errors — Windows File Sharing from Linux Troubleshooting

Warningnetwork

Overview

Fix Linux Samba errors including share access denied, Windows 10/11 compatibility issues, SMB version conflicts, and samba service configuration problems.

Key Details

  • Samba provides SMB/CIFS file sharing between Linux and Windows systems
  • Configuration file: /etc/samba/smb.conf defines shares, authentication, and protocol settings
  • Samba users are separate from Linux users — must be created with smbpasswd -a username
  • Windows 10/11 may require SMB2 or SMB3 minimum — SMB1 is disabled by default in Windows
  • testparm validates smb.conf syntax and shows the effective configuration

Common Causes

  • Samba user not created (system users are not automatically Samba users)
  • Windows requiring SMB2+ but Samba configured for SMB1 only
  • Share path permissions not allowing the Samba user read/write access
  • Firewall blocking SMB ports (TCP 445, TCP 139, UDP 137-138)
  • SELinux/AppArmor blocking Samba access to the shared directory

Steps

  1. 1Create Samba user: sudo smbpasswd -a username (user must exist as a system user first)
  2. 2Test configuration: testparm to validate smb.conf syntax
  3. 3Restart Samba: sudo systemctl restart smbd nmbd
  4. 4Set minimum protocol: add 'min protocol = SMB2' to [global] in smb.conf
  5. 5Fix directory permissions: chmod 2775 /share && chown user:sambashare /share
  6. 6Fix SELinux: chcon -t samba_share_t /share -R or setsebool -P samba_enable_home_dirs on

Tags

sambasmbfile-sharingwindowscifs

Related Items

More in Network

Frequently Asked Questions

Windows 11 requires SMB2 minimum. Add 'min protocol = SMB2' to [global] in smb.conf. Also ensure the Samba user has a password set with smbpasswd.