Windows file sharing lets another computer connect to a folder on your VPS using SMB. Use it when you specifically need a Windows network share, for example to move files from another Windows machine or to let a trusted office PC access a folder.

For one-off uploads, Remote Desktop copy and paste, SFTP, or a temporary download link is usually simpler and safer. If you do use SMB, only allow the IP addresses that need access and remove the share when you are finished.

  1. Decide which folder you want to share. In this example the folder is C:\Share.
  2. Create a separate Windows user for the share. Open PowerShell as Administrator and run:
    net user ShareUser StrongPasswordHere /add

    Do not use the main Administrator account for routine file sharing.

  3. Create the folder if it does not already exist:
    New-Item -ItemType Directory -Path C:\Share
  4. Give the share user permission to the folder. This example allows the user to add, edit, and remove files inside the share:
    icacls C:\Share /grant ShareUser:(OI)(CI)M

    If the user only needs to download files, give read-only access instead:

    icacls C:\Share /grant ShareUser:(OI)(CI)R
  5. Create the SMB share. This example creates a password-protected share named Share and gives ShareUser change access:
    New-SmbShare -Name "Share" -Path "C:\Share" -ChangeAccess "ShareUser"

    For a read-only share, use -ReadAccess instead of -ChangeAccess.

  6. Allow SMB through Windows Firewall from trusted IP addresses only. SMB uses TCP port 445. Replace TRUSTED_PUBLIC_IP with the public IP address that should be allowed to connect:
    New-NetFirewallRule -DisplayName "SMB from trusted IP" -Direction Inbound -Protocol TCP -LocalPort 445 -RemoteAddress TRUSTED_PUBLIC_IP -Action Allow

    If more than one IP needs access, separate them with commas. Do not open TCP 445 to all IP addresses.

  7. If your VPS has a panel firewall as well, add the same TCP 445 allow rule there. Keep the source limited to the same trusted IP addresses.
  8. Connect from the other Windows computer. Open File Explorer and enter:
    \\VPS_IP_ADDRESS\Share

    When Windows asks for credentials, sign in with the share user you created, for example ShareUser.

  9. Check the share exists if you need to confirm it from the VPS:
    Get-SmbShare
  10. Remove the share when it is no longer needed:
    Remove-SmbShare -Name "Share"
  11. Remove the firewall rule as well:
    Remove-NetFirewallRule -DisplayName "SMB from trusted IP"

Leaving SMB open to the internet is unsafe and will attract automated scans. Keep shares temporary, password protected, and limited to trusted source IP addresses.

  • 0 Utenti hanno trovato utile questa risposta
Hai trovato utile questa risposta?

Articoli Correlati

Installing SteamCMD on your Windows VPS

SteamCMD is Valve's command-line tool for downloading and updating dedicated server files...

How to change your Windows VPS Administrator password

You can change the main Windows VPS login password from the VPS control panel. This is useful if...

How to open Windows Firewall ports on your VPS

Windows Firewall controls which inbound connections are allowed into your Windows VPS. If you...

How to open and use PowerShell on a Windows VPS

PowerShell is the main command-line tool for managing a Windows VPS. You can use it to install...

How to connect to a Windows VPS with Remote Desktop

Remote Desktop is the normal way to manage a Windows VPS. It opens a desktop session so you can...