How to Map a Network Drive over SSH on Windows

Windows network drive mapped securely over SSH

You can map a remote Linux server, VPS, Raspberry Pi, or NAS as a Windows drive without exposing an SMB share to the internet. SSHFS-Win carries the file traffic over SSH, while WinFsp makes the remote folder appear in File Explorer with a normal drive letter.

Updated August 2026: corrected the current SSHFS-Win port syntax and added WinGet installation, command-line mapping, SSH-key options, disconnection steps, and troubleshooting.

What you need

  • A remote computer with an SSH server that you can already reach.
  • The SSH hostname or IP address, SSH username, and—if it is not the default—port number.
  • WinFsp and SSHFS-Win installed on Windows.

Before mapping the drive, test the same login in PowerShell. This separates SSH or firewall problems from SSHFS-Win problems:

ssh [email protected]

For a non-standard SSH port, use:

ssh [email protected] -p 2222

Install WinFsp and SSHFS-Win

The easiest current installation method is Windows Package Manager. Open PowerShell or Windows Terminal and run:

winget install SSHFS-Win.SSHFS-Win

You can also install them manually. Install the latest WinFsp release first, followed by the SSHFS-Win installer that matches your Windows architecture. Download both only from their official GitHub release pages linked above.

Map the SSH folder in Windows File Explorer

  1. Open File Explorer and select This PC.
  2. Open the three-dot menu or right-click This PC, then select Map network drive.
  3. Choose an unused drive letter.
  4. Enter the SSHFS-Win UNC path in the Folder field.
  5. Select Reconnect at sign-in only if you want Windows to remember the mapping.
  6. Click Finish and enter the SSH account credentials when prompted.
Map Network Drive option in Windows File Explorer
SSHFS network path entered in the Map Network Drive dialog

SSHFS-Win UNC path syntax

The current SSHFS-Win syntax is:

sshfsREMOTE_USER@HOST[!PORT][PATH]

Important: a custom port is introduced with an exclamation mark (!), not a colon. For example:

[email protected]!2222projects

Map the remote user’s home directory

The standard sshfs prefix treats the path as relative to the remote user’s home directory:

[email protected]
[email protected]

Map a path from the server root

Use sshfs.r when the path should start at the remote server’s filesystem root. The remote account must still have permission to read or write the selected location:

[email protected]
SSH server password prompt for the mapped network drive

After authentication, the remote folder appears under This PC and can be used by File Explorer and most Windows applications.

Remote SSH folder mounted as a Windows network drive

Map the SSH drive from the command line

You can create the same mapping with the built-in net use command. The following example maps drive Z: and prompts for the password:

net use Z: [email protected]

List current mappings with:

net use

Disconnect the drive with:

net use Z: /delete

Avoid putting the SSH password directly in a command because it can be exposed in shell history or process information.

Use SSH key authentication

SSHFS-Win provides sshfs.k for a home-relative path and sshfs.kr for a root-relative path. By default, these prefixes use the private key at %USERPROFILE%.sshid_rsa:

[email protected]
[email protected]

According to the current SSHFS-Win documentation, this direct UNC key method supports keys without a passphrase. If you need a passphrase-protected key, an SSH agent, or easier management of several connections, consider one of the GUI front ends listed by the project, such as SiriKali or SSHFS-Win-Manager.

Troubleshooting common SSHFS-Win problems

Windows cannot find the network path

Confirm that both WinFsp and SSHFS-Win are installed, then check the UNC path carefully. Use ! before a custom port and backslashes in the Windows path. Also verify that the SSH hostname resolves from the Windows PC.

The password is rejected

Test the account with the Windows ssh command first. If that fails too, check the username, port, firewall, server authentication settings, and account permissions. If normal SSH works but the mapped drive does not, remove the mapping and any incorrect saved entry from Windows Credential Manager before trying again.

The drive opens but a folder is missing or read-only

The sshfs prefix begins in the remote user’s home directory; sshfs.r begins at the server root. Neither prefix bypasses Linux permissions. Confirm that the SSH user can access the target folder on the server.

The connection drops while idle

The SSHFS-Win project documents a ServerAliveInterval option and provides a registry patch for mapped drives. Review the project’s official instructions and back up the relevant registry settings before applying any registry change.

Security and performance notes

  • Verify an unfamiliar SSH host-key fingerprint with the server administrator before accepting it.
  • Prefer SSH keys where practical and keep private keys protected.
  • Do not expose SMB ports to the public internet just to map a drive; SSHFS is designed to carry the connection through SSH.
  • SSHFS is convenient for remote administration and ordinary file access, but encryption and network latency can make it slower than local storage or SMB on a trusted LAN.
  • Keep WinFsp, SSHFS-Win, Windows, and the remote SSH server updated.

Frequently asked questions

Can I map a Raspberry Pi folder as a Windows drive?

Yes. Enable and secure SSH on the Raspberry Pi, verify that ssh user@raspberrypi works from Windows, and then map the same user and host with SSHFS-Win. If you are building a dedicated storage system, see this Raspberry Pi 5 NAS project for a practical hardware example.

Does SSHFS-Win use port 22?

Yes, unless you specify another port. Add a custom port with !PORT, for example sshfsuser@host!2222.

How do I permanently remove the mapped drive?

Right-click the mapped drive in File Explorer and select Disconnect, or run net use Z: /delete with the correct drive letter.

Official references: SSHFS-Win documentation and WinFsp project.

Share this Article:

2 thoughts on “How to Map a Network Drive over SSH on Windows”

  1. Peter King

    This does not say anything about how to set up the map to use ssh public/private keys instead of login/pass, which in many cases is the only option…

  2. Oooh yes! Perfect, this is absoluteley seamless with Windows. No fiddly file configs, and it just works!

    Many thanks for posting

Leave a Comment

Scroll to Top