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 Questions and AnswersWindows 11

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
0
Facebook Twitter Google + Pinterest
previous post
Configure NTP Time Source for Active Directory Domain

Related Reading

Configure NTP Time Source for Active Directory Domain

May 6, 2025

How to Cancel Windows Update Pending Restart Loop

May 6, 2025

View Windows Update History with PowerShell (CMD)

April 30, 2025

Change BIOS from Legacy to UEFI without Reinstalling...

April 21, 2025

Remove ‘Your License isn’t Genuine’ Banner in MS...

April 21, 2025

Leave a Comment Cancel Reply

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

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMware
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • 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
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025
  • How to Write Logs to the Windows Event Viewer from PowerShell/CMD

    March 3, 2025
  • How to Hide (Block) a Specific Windows Update

    February 25, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Fix: Windows Update Tab (Button) is Missing from Settings
  • Permanently Disable Driver Signature Enforcement on Windows 11
  • Fix: Your IT Administrator Has Limited Access to Virus & Threat Protection
  • Fix: Multiple Connections to a Server or Shared Resources by the Same User
  • How to Add or Reinstall the Microsoft PDF Printer on Windows
  • VPN Error 633: The modem is already in use or not configured
  • Configure NTP Time Source for Active Directory Domain
Footer Logo

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


Back To Top