Logo

Sharing and Mounting a Network Folder from a Windows VPS to a Local PC

Sharing and Mounting a Network Folder from a Windows VPS to a Local PC

This guide explains how to create a shared folder on a Windows VPS and mount it as a network drive on a local PC, following best security practices

Introduction

Windows network sharing allows you to access VPS files as if they were on your local PC.
This guide covers all the steps from folder creation to secure mounting on your computer, applying best practices to minimize risk.


Prerequisites

  • Windows VPS (Server or Windows 10/11) accessible via RDP
  • Administrator account on the VPS
  • Local PC running Windows with admin rights
  • Stable and secure network connection
  • Windows Firewall enabled on the VPS

Creating the Folder to Share

  1. Connect to the VPS via RDP.
  2. Create a folder to share, for example:

C:\SharedData

  1. Right-click the folder → Properties → Security and Sharing.
  2. Ensure you are the owner of the folder and have full control.

Creating a Dedicated User for the Share

To secure the share, create a specific user:

# Create a new user
net user ShareUser StrongPasswordHere /add

# Add the user to the Users group (avoid Admin unless necessary)
net localgroup Users ShareUser /add

Tip: Use a strong, unique password.


Sharing the Folder and Setting Permissions

  1. Go to Properties → Sharing → Advanced Sharing.
  2. Check Share this folder and give it a simple name (SharedData).
  3. Click Permissions, add the created user (ShareUser), and allow Read/Write.
  4. In Properties → Security, verify that only authorized users have access.
  5. Remove Everyone to prevent unauthorized access.

Configuring Windows Firewall

Windows sharing uses SMB (TCP 445 and 139).

  1. Open PowerShell as Administrator and create a rule for your local PC:
New-NetFirewallRule -DisplayName "SMB - Local PC" -Direction Inbound -Protocol TCP -LocalPort 445,139 -RemoteAddress <PC_IP> -Action Allow
  1. Verify the rule is active:
Get-NetFirewallRule -DisplayName "SMB - Local PC"

Important: Never expose SMB to the public internet.


Enabling and Configuring SMB

  1. Check available SMB versions:
Get-SmbServerConfiguration | Select EnableSMB1Protocol, EnableSMB2Protocol
  1. Disable SMBv1 for security if possible:
Set-SmbServerConfiguration -EnableSMB1Protocol $false
  1. Keep SMBv2/3 active for modern and secure sharing.

Mounting the Network Drive on a Local PC

  1. On your local PC, open File Explorer → This PC → Map Network Drive.
  2. Choose a drive letter (e.g., Z:).
  3. In the Folder field, enter the VPS address:
\\<VPS_IP>\SharedData
  1. Check Reconnect at sign-in if desired.
  2. Click Finish, then enter the credentials of ShareUser.

Automatic Connection at Startup

To reconnect the network drive automatically:

  1. Create a batch file (.bat):
net use Z: \\<VPS_IP>\SharedData /user:ShareUser StrongPasswordHere /persistent:yes
  1. Place the batch file in the Startup folder on your PC.

Testing and Verification

  • Access the network drive from your PC and create a test file.
  • Check that changes appear correctly on the VPS.
  • Test disconnect and reconnect to ensure persistence.

Security Best Practices

  • Limit share access to a specific IP or via VPN.
  • Use a dedicated user with a strong password.
  • Enable SMB encryption (SMB 3.0).
  • Monitor connection logs for unauthorized access attempts.
  • Avoid sharing folders with sensitive data directly on the internet.
  • Keep the Windows system up to date.

Useful Resources

Join our Discord community server

For any questions, suggestions, or just to chat with the community, join us on Discord!

900+Members