Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบ >> Windows Server

ไม่สามารถเข้าถึงโฟลเดอร์แชร์ หรือ Map Network Drive จาก Windows 10 และ 11

หากไม่สามารถเปิดหรือ Map โฟลเดอร์แชร์บน NAS, เซิร์ฟเวอร์ Samba Linux, หรือคอมพิวเตอร์ Windows เก่า (Windows 7/XP/Server 2003) จาก Windows 10 หรือ 11 สาเหตุส่วนใหญ่คือ Protocol SMB รุ่นเก่าและไม่ปลอดภาถูกปิดใช้งานใน Windows Build ล่าสุด (SMB ใช้สำหรับเข้าถึงโฟลเดอร์/ไฟล์แชร์เครือข่ายใน Windows)

Microsoft ปิดใช้งาน SMBv1 และการเข้าถึงแบบ Anonymous (Guest) ให้กับโฟลเดอร์แชร์เครือข่ายโดยค่าเริ่มต้น ตั้งแต่ Windows 10 1709 และ Windows Server 2019 (ทั้ง Datacenter และ Standard)

ขั้นตอนการแก้ไขขึ้นอยู่กับข้อผิดพลาดที่ปรากฏใน Windows ตอนเข้าถึงโฟลเดอร์แชร์ และการตั้งค่าของ SMB Server ระยะไกลที่เป็นโฮสต์ Network Share

ไม่สามารถเข้าถึงโฟลเดอร์แชร์ เพราะ Security Policy บล็อก Unauthenticated Guest Access

ตั้งแต่ Windows 10 Build 1709 Fall Creators Update (Enterprise และ Education Editions) ผู้ใช้รายงานว่าเมื่อพยายามเปิดโฟลเดอร์แชร์เครือข่ายบนเครื่องเคียงเคียง ข้อผิดพลาดปรากฏ:

Restoring Network Connections An error occurs when you try to open a network folder: An error occurred while reconnecting Y: to \\nas1\share Microsoft Windows Network: You can't access this shared folder because your organization's security policies block unauthenticated guest access. These policies help protect your PC from unsafe or malicious devices on the network.

ไม่สามารถเข้าถึงโฟลเดอร์แชร์ หรือ Map Network Drive จาก Windows 10 และ 11

ในขณะที่คอมพิวเตอร์ Windows 8.1, Windows 7, หรือ Windows 10 Build ต่ำกว่า 1709 เปิดโฟลเดอร์แชร์เดียวกันได้ปกติ สาเหตุคือ Windows 10 เวอร์ชันใหม่ (Build 1709+) ปิด Guest Access ผ่าน SMBv2 โดยค่าเริ่มต้น Guest (Anonymous) หมายถึงการเข้าถึงโฟลเดอร์แชร์โดยไม่ต้องยืนยันตัวตน เมื่อเข้าถึงผ่านบัญชี Guest บน SMBv1/v2 วิธีป้องกันトラフィคอย่าง SMB Signing และ Encryption ไม่ได้ถูกใช้ ทำให้ Session รู้สึกอ่อนไหวต่อการโจมตี MiTM (Man-in-the-Middle)

การเปลี่ยนแปลงนี้ไม่ได้นำไปใช้กับ Windows 10 Home Editions การเข้าถึงเครือข่ายภายใต้บัญชี Guest ทำงานปกติ

หากพยายามเปิดโฟลเดอร์แชร์ผ่าน SMB v2 ภายใต้บัญชี Guest ข้อผิดพลาดจะปรากฏใน Event Viewer ของคอมพิวเตอร์ (SMB Client):

Log Name: Microsoft-Windows-SmbClient/Security Source: Microsoft-Windows-SMBClient Event ID: 31017 Rejected an insecure guest logon.

ข้อผิดพลาดนี้บอกว่าคอมพิวเตอร์ของคุณ (Client) บล็อกการเข้าถึงแบบไม่ยืนยันตัวตนภายใต้บัญชี Guest

กรณีส่วนใหญ่เกิดเมื่อเข้าถึง NAS เก่า (โดยปกติเปิด Guest Access เพื่อความสะดวก) หรือเปิดโฟลเดอร์แชร์บน Windows 7/2008 R2/XP/2003 ที่เปิด Anonymous (Guest) Access (ดูตาราง SMB Protocol Versions ที่รองรับใน Windows Editions ต่างๆ)

Microsoft แนะนำให้เปลี่ยนการตั้งค่าบนคอมพิวเตอร์ระยะไกลหรือ NAS ที่เป็นโฮสต์โฟลเดอร์แชร์ ควรเปลี่ยน Network Share ให้ใช้โหมด SMBv3 หรือตั้งค่าการเข้าถึงด้วยการยืนยันตัวตน หากอุปกรณ์รองรับแค่ SMBv2 นี่คือวิธีที่ถูกต้องและปลอดภัยที่สุด

ปิด Guest Access บนอุปกรณ์ที่เก็บโฟลเดอร์แชร์:

  • NAS Devices – ปิด Guest Access ในการตั้งค่า NAS (ขึ้นกับ Vendor และ Model)
  • Samba Server on Linux — เพิ่มสตริงต่อไปนี้ใน smb.conf ภายใต้ Section [global]: map to guest = never และจำกัด Anonymous Access ใน Section โฟลเดอร์แชร์: guest ok = no
  • ใน Windows เปิดใช้การแชร์โฟลเดอร์/เครื่องพิมพ์พร้อมการป้องกันรหัสผ่าน ผ่าน Control Panel → Network and Sharing Center → Advanced sharing settings สำหรับ All Networks ใน Section "Password Protected Sharing" เปลี่ยนเป็น "Turn on password protected sharing" กรณีนี้ Anonymous (Guest) Access จะถูกปิด ต้องสร้าง Local User ให้สิทธิ์เข้าถึงโฟลเดอร์/เครื่องพิมพ์แชร์ และใช้บัญชีเหล่านี้เชื่อมต่อ ไม่สามารถเข้าถึงโฟลเดอร์แชร์ หรือ Map Network Drive จาก Windows 10 และ 11

อีกวิธีหนึ่ง – เปลี่ยนการตั้งค่าบน Windows ของคุณ เพื่ออนุญาตให้เข้าถึงโฟลเดอร์แชร์ภายใต้บัญชี Guest วิธีนี้ควรใช้เป็น Workaround ชั่วคราว (!!!) เพราะการเข้าถึงโฟลเดอร์โดยไม่ยืนยันตัวตนลดความปลอดภัยของคอมพิวเตอร์ลงมาก

เพื่อเปิด Guest Access จากคอมพิวเตอร์ของคุณ ใช้ Group Policy Editor (gpedit.msc) ไปที่ Section: Computer Configuration → Administrative templates → Network → Lanman Workstation หาและเปิดใช้งาน Policy Enable insecure guest logons Policy นี้กำหนดว่า SMB Client จะอนุญาต Unsafe Guest Logon ให้ SMB Server หรือไม่

ไม่สามารถเข้าถึงโฟลเดอร์แชร์ หรือ Map Network Drive จาก Windows 10 และ 11

อัปเดต Group Policy:

gpupdate /force

บน Windows 10 Home ที่ไม่มี Local GPO Editor เปลี่ยนผ่าน Registry Editor แบบ Manual:

HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters “AllowInsecureGuestAuth”=dword:1

หรือด้วยคำสั่ง:

reg add HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters /v AllowInsecureGuestAuth /t reg_dword /d 00000001 /f
reg add HKLM\Software\Policies\Microsoft\Windows\LanmanWorkstation /v AllowInsecureGuestAuth /t reg_dword /d 00000001 /f

ไม่สามารถเชื่อมต่อ File Share เพราะไม่ปลอดภัย และต้องการ SMB1 Protocol ที่ล้าสมัย

ปัญหาอีกประการหนึ่ง: Server-side รองรับเฉพาะ SMBv1 เท่านั้น เนื่องจาก SMBv1 Client ถูกปิดโดยค่าเริ่มต้นใน Windows 10 1709+ เมื่อพยายามเปิดโฟลเดอร์แชร์หรือ Map Network Drive อาจได้ข้อผิดพลาด:

You can't connect to the file share because it's not secure. This share requires the obsolete SMB1 protocol, which is unsafe and could expose your system to attack. Your system requires SMB2 or higher.

ไม่สามารถเข้าถึงโฟลเดอร์แชร์ หรือ Map Network Drive จาก Windows 10 และ 11

ในกรณีนี้ คอมพิวเตอร์เคียงเคียงอาจไม่แสดงบนเครือข่ายท้องถิ่น และเมื่อเปิดโฟลเดอร์แชร์ด้วย UNC Path อาจเกิด Error 0x80070035

ข้อความผิดพลาดชี้ให้เห็นชัดเจนว่า Network Share รองรับเฉพาะ SMBv1 Client Access Protocol ควรพยายามกำหนดค่า Remote SMB Device ใหม่ให้ใช้ SMBv2 ขึ้นไป (วิธีที่ถูกต้องและปลอดภัย)

หากใช้ Samba Server บน Linux แชร์ไฟล์ สามารถระบุ Minimum Supported SMB Protocol Version ใน smb.conf ได้:

[global] server min protocol = SMB2_10 client max protocol = SMB3 client min protocol = SMB2_10 encrypt passwords = true restrict anonymous = 2

บน Windows 7/Windows Server 2008 R2 ปิด SMB1 และเปิด SMBv2 ผ่าน Registry ด้วย PowerShell:

Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 0 –Force
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB2 -Type DWORD -Value 1 –Force

บน Windows 8.1/Windows Server 2012 R2 ปิด SMBv1 อนุญาต SMBv2 และ SMBv3 (ตรวจสอบว่าใช้ Private หรือ Domain Profile สำหรับการเชื่อมต่อเครือข่าย):

Disable-WindowsOptionalFeature -Online -FeatureName "SMB1Protocol"
Set-SmbServerConfiguration –EnableSMB2Protocol $true

หากอุปกรณ์เครือข่าย (NAS, Windows XP, Windows Server 2003) รองรับแค่ SMB1 สามารถเปิด Feature แยก SMB1Protocol-Client บน Windows 10/11 หรือ Windows Server ได้ แต่ ไม่แนะนำ !!!

หากอุปกรณ์ระยะไกลต้องการ SMBv1 แต่ปิดอยู่บน Windows ของคุณ จะเกิด Error ใน Event Viewer:

Log Name: Microsoft-Windows-SmbClient/Security Source: Microsoft-Windows-SMBClient Event ID: 32000 Description: SMB1 negotiate response received from a remote device when SMB1 cannot be negotiated by the local computer.

รัน PowerShell แบบ Elevated ตรวจสอบว่า SMB1Protocol-Client ปิดอยู่ (State: Disabled):

Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol-Client

เปิดใช้งาน SMBv1 Client Protocol (ต้อง Reboot):

Enable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol-Client

ไม่สามารถเข้าถึงโฟลเดอร์แชร์ หรือ Map Network Drive จาก Windows 10 และ 11

เปิด/ปิด Feature เพิ่มเติมใน Windows 10/11 จาก optionalfeatures.exe ขยาย SMB 1.0/CIFS File Sharing Support เปิด SMB 1.0/CIFS Client

ไม่สามารถเข้าถึงโฟลเดอร์แชร์ หรือ Map Network Drive จาก Windows 10 และ 11

บน Windows 10 1809 ขึ้นไป SMBv1 Client จะถูกลบอัตโนมัติหากไม่ได้ใช้งานเกิน 15 วัน (Component SMB 1.0/CIFS Automatic Removal ทำหน้าที่นี้)

ตัวอย่างนี้เปิดแค่ SMBv1 Client ไม่ควรเปิด SMB1Protocol-Server หากคอมพิวเตอร์ไม่ได้ใช้เป็น SMB Server สำหรับ Legacy Clients

หลังติดตั้ง SMBv1 Client ควรเชื่อมต่อโฟลเดอร์แชร์/เครื่องพิมพ์ได้ปกติ แต่ควรเข้าใจว่า Workaround นี้ไม่แนะนำ เพราะลดความปลอดภัยของคอมพิวเตอร์

Windows Cannot Access Shared Folder: You Don't Have Permissions

ตอนเชื่อมต่อโฟลเดอร์แชร์เครือข่ายบนคอมพิวเตอร์ระยะไกล อาจเกิดข้อผิดพลาด:

Network Error Windows cannot access \\PC12\Share You do not have permission to access \\PC12\Share. Contact your network administrator to request access.

ไม่สามารถเข้าถึงโฟลเดอร์แชร์ หรือ Map Network Drive จาก Windows 10 และ 11

เมื่อเกิดข้อผิดพลาดนี้ ให้:

  1. ตรวจสอบว่าผู้ใช้ที่ใช้เข้าถึงโฟลเดอร์แชร์ มีสิทธิ์เข้าถึงบน Remote Share เปิด Properties ของโฟลเดอร์แชร์บน Server ตรวจสอบว่าผู้ใช้ของคุณมีอย่างน้อย Read Permission ตรวจสอบ Share Permissions บน Remote Host ด้วย PowerShell: Get-SmbShareAccess -Name "tools" ตรวจสอบ NTFS Folder Permissions: get-acl C:\tools\ |fl ไม่สามารถเข้าถึงโฟลเดอร์แชร์ หรือ Map Network Drive จาก Windows 10 และ 11 หากจำเป็น ให้แก้ไขสิทธิ์ใน Properties ของโฟลเดอร์และ/หรือ Share
  2. ตรวจสอบว่าใช้ Username และ Password ที่ถูกต้องในการเข้าถึงโฟลเดอร์เครือข่าย หากไม่ได้รับ Prompt ขอ Username/Password ลองลบ Credentials ที่ Cache ไว้สำหรับ Remote Shares ใน Windows Credential Manager รันคำสั่ง rundll32.exe keymgr.dll, KRShowKeyMgr และลบ Cached Credentials สำหรับคอมพิวเตอร์ระยะไกลที่พยายามเข้าถึง ไม่สามารถเข้าถึงโฟลเดอร์แชร์ หรือ Map Network Drive จาก Windows 10 และ 11 ครั้งต่อไปที่เชื่อมต่อโฟลเดอร์แชร์ จะถูกขอ Username/Password ระบุ Credentials เพื่อเข้าถึงโฟลเดอร์แชร์เครือข่ายบนคอมพิวเตอร์ระยะไกล สามารถบันทึกใน Credential Manager หรือเพิ่มด้วยตนเองได้

วิธีแก้ไขอื่นๆ: Windows Cannot Access Shared Folders

ส่วนนี้ให้วิธี Troubleshooting เพิ่มเติมสำหรับปัญหาเปิดโฟลเดอร์เครือข่ายใน Windows:

  • ตรวจสอบว่าคอมพิวเตอร์ระยะไกลอนุญาต Incoming Connections ไปยังโฟลเดอร์แชร์ผ่าน SMB Protocol (TCP Port 445) ตรวจสอบ Port 445 บนคอมพิวเตอร์ระยะไกลด้วย Test-NetConnection: Test-NetConnection -ComputerName HomePC212 -Port 445 ไม่สามารถเข้าถึงโฟลเดอร์แชร์ หรือ Map Network Drive จาก Windows 10 และ 11 หาก Cmdlet คืนค่า TcpTestSucceeded : False หมายถึงการเข้าถึงโฟลเดอร์แชร์บนคอมพิวเตอร์ระยะไกลถูกบล็อกโดย Firewall อาจถูกบล็อกโดย Antivirus หรือ Firewall (Third-party หรือ Windows Defender Firewall built-in) หากใช้ Windows Defender ให้เปิด Rule File and Printer Sharing (Control Panel\System and Security\Windows Defender Firewall\Allowed apps\Allow apps to communicate through Windows Firewall) บน File Share Host สำหรับ Network Profile ทั้งสาม ไม่สามารถเข้าถึงโฟลเดอร์แชร์ หรือ Map Network Drive จาก Windows 10 และ 11 หรือสร้าง Firewall Rule ด้วย PowerShell: New-NetFirewallRule -DisplayName "Allow_SBM-FileSharing_In" -Direction Inbound -Protocol TCP –LocalPort 445 -Action Allow
  • หากไม่สามารถเปิด Mapped Network Drives ได้ ลองลบ Saved Cached Credentials ใน Windows Credential Manager, ลบ Mapped Network Drives (คำสั่ง Net Use * /delete) และเชื่อมต่อใหม่
  • ลองใช้ IP Address ของคอมพิวเตอร์ระยะไกลแทนชื่อ เพื่อเข้าถึงโฟลเดอร์ เช่น: Win+R → \\192.168.12.20 → Ok
  • ตรวจสอบว่าคอมพิวเตอร์อยู่ใน Workgroup เดียวกัน ชื่อ Workgroup หาได้ด้วย PowerShell: Get-WmiObject Win32_ComputerSystem).domain
  • Reset TCP/IP Stack และอัปเดต IP Address: netsh int ip reset
    netsh winsock reset
    ipconfig /flushdns
    ipconfig /release
    ipconfig /renew