Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การแก้ไขปัญหา >> Mac

แก้ File Sharing ไม่ทำงานบน macOS High Sierra, Mojave และใหม่กว่า

File Sharing บน Mac ช่วยให้แชร์ไฟล์/โฟลเดอร์ในเครือข่าย LAN ได้ แต่มักพังหลัง Update macOS (High Sierra Security Patch, Mojave, Ventura, Sonoma) สาเหตุ: SMB/Kerberos Bug, Firewall/Antivirus, Corrupt Config, Junk Files บทความนี้ให้ วิธีแก้ครบถ้วน ตั้งแต่คำสั่ง Apple Official จนถึงการใช้ iCloud Drive ทดแทน

วิธีที่ 1: คำสั่ง Apple Official (แก้ High Sierra Kerberos Bug)

Apple เปลี่ยน Security Patch ใน High Sierra ทำให้ Kerberos KDC เสีย → File Sharing พัง

  1. เปิด Terminal (Applications → Utilities)
  2. รันคำสั่ง: sudo /usr/libexec/configureLocalKDC
  3. ใส่ Admin Password (ไม่แสดงตัวอักษร) → Enter
  4. Quit Terminal → Restart Mac
  5. ทดสอบ File Sharing

หมายเหตุ: คำสั่งนี้ยังใช้ได้บน macOS ใหม่กว่า หากเจอปัญหา Kerberos/SMB เหมือนเดิม

วิธีที่ 2: ล้าง Junk Files (มองข้ามง่าย แต่มีผลมาก)

Junk, Cache, Log, Duplicate, Large Files → ทำให้ System Process (smbd, kdc) ลงตัวไม่ได้/ช้า

  • ใช้ iMyMac PowerMyMac → Smart Scan → Clean
  • ล้าง: System Junk, User Cache, Logs, Mail Attachments, iTunes Junk, Trash
  • Restart → ทดสอบ File Sharing อีกครั้ง

วิธีที่ 3: ปิด/ตั้งค่า Antivirus & Firewall

  • Antivirus (Bitdefender, Norton, Avast, Kaspersky, Intego, CleanMyMac X Menu) → ปิดชั่วคราว → ทดสอบ
  • Firewall: System Settings → Network → Firewall → Options → ตรวจสอบ "Block all incoming connections" ไม่ได้ติ๊ก
  • Third-party Firewall (Little Snitch, LuLu, Murus, Radio Silence) → เพิ่ม Rule Allow: smbd, netbiosd, kdc หรือปิดชั่วคราว
  • Windows Network Profile: ถ้าเชื่อม Mac-Windows → ตั้ง Network Profile เป็น Private (ไม่ใช่ Public)

วิธีที่ 4: ตั้งค่า File Sharing ใหม่ (Reset Config)

  1. System Settings → General → Sharing
  2. ปิด File Sharing → รอ 10 วินาที → เปิดใหม่
  3. Shared Folders: ลบโฟลเดอร์เก่าทั้งหมด (-) → เพิ่มใหม่ (+) → เลือกโฟลเดอร์ที่จะแชร์
  4. Users: เพิ่ม User ที่อนุญาต → ตั้ง Permission (Read Only / Read & Write)
  5. Options... → ติ๊ก Share files and folders using SMB → เลือก User → ใส่ Password → Done

วิธีที่ 5: ใช้ iCloud Drive แทน (Modern Alternative)

File Sharing (SMB/AFP) เป็นเทคโนโลยีเก่า ซับซ้อน ใช้ iCloud Drive แทนได้สะดวกกว่ามาก

  1. System Settings → Apple ID → iCloud → iCloud Drive → Options
  2. ติ๊ก Desktop & Documents Folders
  3. ติ๊ก Optimize Mac Storage
  4. บนอุปกรณ์อื่น (Mac/iPhone/iPad/Windows iCloud.com): Sign in Apple ID เดียวกัน → เข้าถึงไฟล์ได้ทุกที่

ข้อดี: Sync อัตโนมัติ, Version History, Sharing Link ได้, ใช้งานจากไหนก็ได้, ไม่ต้องอยู่ LAN เดียวกัน

วิธีที่ 6: เช็ค SMB Version และ Network

  • Mac ใช้ SMB 2/3 → Windows 10/11 รองรับดี
  • Terminal: smbutil statshares -a ดู Connection Status
  • ปิด SMB Signing (ถ้าช้า): sudo defaults write /Library/Preferences/com.apple.smb.server SigningRequired 0 → Restart
  • MTU Size: Router ตั้ง 1500 (Standard) Jumbo Frame อาจทำให้ SMB พัง

เชื่อมจาก Windows / Linux

Windows:

  1. File Explorer → Address Bar: \\Mac-IP-Address หรือ \\Mac-Hostname.local
  2. User: MacUsername / Password: MacPassword
  3. Credential Manager → Windows Credentials → Add Windows Credential (เก็บไว้)

Linux:

# Install cifs-utils
sudo mount -t cifs //Mac-IP/ShareName /mnt/mac -o username=MacUser,vers=3.0

สรุป Checklist

  1. ☑ รัน sudo /usr/libexec/configureLocalKDC (Apple Official Fix)
  2. ☑ PowerMyMac Smart Scan Clean Junk
  3. ☑ ปิด Antivirus/Firewall ทดสอบ
  4. ☑ Reset File Sharing Config (Off/On, Re-add Folders/Users)
  5. ☑ ลอง iCloud Drive แทน (แนะนำ)
  6. ☑ เช็ค SMB Version/Network/MTU

แนะนำ: ใช้ iCloud Drive + Desktop & Documents Sync เป็นหลัก (ทันสมัย สะดวก ไม่พัง) เก็บ File Sharing (SMB) ไว้เฉพาะ: Legacy App, Windows/Linux Server, หรือเครือข่ายที่ห้าม Cloud