Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / Windows 11 / Map a Network Drive over SSH (SSHFS) in Windows

May 13, 2025

Map a Network Drive over SSH (SSHFS) in Windows

To mount the file system of a remote server as a network drive in Windows, you can use the secure SSH protocol instead of the traditional SMB (Samba) connection. This is useful when you need to secure access files on a remote SSH server locally without creating a separate FTP (SFTP) connection. The SSHFS-Win client can be used to mount remote file systems in Windows via SSH. This client allows transparently map remote directories using the SSHFS protocol (based on SSH File Transfer Protocol, SFTP).

Download the SSHFS-Win MSI installer manually or install it using the built-in WinGet package manager:

winget install SSHFS-Win.SSHFS-Win

Install SSHFS-Win.SSHFS-Win

You can now mount a remote folder as a network drive directly from Windows File Explorer GUI. Right-click on This PC and select Map Network Drive. Select the drive letter to assign and the UNC path to the remote directory in the following format:

\\prefix\\user@host[!PORT][\\PATH]

user – the user account used to authenticate to the remote SSH host

host – host name/IP address

Use one of the following values as a prefix:

  • sshfs – map the user’s home directory (the user’s profile directory on Windows). In addition, specify the relative path to any directory in the user profile (working dir).
  • sshfs.r – mount the root directory of the remote computer (for Windows, this refers to the root of the system drive).
  • sshfs.k – map the user’s home directory. SSH key in %USERPROFILE%/.ssh/id_rsa is used for authentication.
  • sshfs.kr – connect to the root directory with SSH key

For example, to map the C:\PS directory from a remote Windows host with the SSH server enabled, enter the following UNC path

\\sshfs.r\[email protected]\ps

When connecting, you’ll be prompted to enter the remote user’s password for authentication (you can choose to save the password in Credential Manager)

Use SSHFS to mount shared folder on Windows over SSH

After that, a separate network drive mapped via SSHFS will appear in Windows Explorer.

Map a network drive over SSH in Windows

You can also map a network drive from the command prompt using the net use:

The following command mounts the /var/www directory from a Linux host as a Windows network drive:

net use W: \\sshfs.r\[email protected]\var\www /user:sysops

Map a directory from a remote Windows host:

net use m: \\sshfs.r\[email protected]\ps /user:administrator

You will be prompted for the user’s password during the connection.

map network drive over ssh using net use

A network drive mapped in this way persists only until the computer is restarted. Add the /persistent:yes option to the command to automatically reconnect the drive when the user logs on.

To map a remote share without having to enter the user’s password each time, you can save the credentials in Windows Credential Manager

cmdkey /add:192.168.123.123 /user:admin /pass:Passw0rdd1

Multiple network drives can be connected simultaneously using the WinFsp.Np provider. List the connected drives:

net use

net use - list mapped folders

Delete a mapped network drive:

net use M: /delete

In the net use command, you can specify the user password in plain text, but it’s more secure to mount the remote folder using SSH key authentication. Generate SSH keys on Windows using the ssh-keygen.exe tool according to the manual at the link (do not specify a passphrase to protect the private key). Add the public key from the .pub file to the authorized_keys (or administrators_authorized_keys ) file on the remote SSH server.

To automatically map a network drive over SSH using key authentication at Windows logon, you can create a scheduled task that runs a PowerShell script:

$remoteUser = "admin"
$remoteHost = "fs01.woshub.com"
$remoteDir = "\Install"
$Drive = "M:"
$privSSHKey = "C:\secret\fs01-id_rsa"
cd 'C:\Program Files\SSHFS-Win\bin\'
$mountcmd = ".\sshfs-win.exe svc \sshfs.k\$remoteUser@$remoteHost$remoteDir $Drive -IdentityFile=$privSSHKey"
Invoke-Expression $mountcmd

You can use a graphical client to map a network directory via SSH. The easiest and most convenient client is SSHFS-Win-Manager. It is possible to create multiple SSHFS connections to remote file systems using the SSHFS-Win-Manager client. It supports both password and key-based authentication.

 SSHFS-Win-Manager - map remote directories over SSH

0 comment
4
Facebook Twitter Google + Pinterest
Windows 11
previous post
Configure NTP Time Source for Active Directory Domain
next post
Unable to Map Drive: An extended error has occurred

Related Reading

How to Assign (Passthrough) a Physical GPU to...

June 11, 2024

Configuring RemoteApps Hosted on Windows 10/11 (without Windows...

January 25, 2025

Disable BitLocker Automatic Drive Encryption in Windows 11

October 16, 2024

Enable Hyper-V on Windows 10/11 Pro and Home...

August 12, 2024

Get Started with Docker on Windows (WSL2) without...

September 4, 2024

Disable and Completely Remove Widgets from Taskbar in...

September 26, 2024

Adding Multiple Alternate DNS Names for a Windows...

September 3, 2024

Bridging Multiple Network Interfaces on Windows

November 21, 2024

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Configuring Windows Protected Print Mode (WPP)

    May 19, 2025
  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Upgrading to Windows 11 on Unsupported Hardware
  • Install Any OS from ISO Image over Network with iVentoy
  • Create a Custom Windows Image with Pre-installed Apps
  • How to Assign (Passthrough) a Physical GPU to a Hyper-V Virtual Machine
  • Run PowerShell Scripts on a Schedule with Task Scheduler
  • Automatic Outlook User Profile Configuration with ZeroConfigExchange
  • Fix: Windows Update Tab (Button) is Missing from Settings
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top