Map network drive over SSH
In my earlier post I wrote about Securing Windows Remote Desktop with OpenSSH. This week we see how we can extend the setup to map a network drive over SHH. It gives you the ability to securely access your files and work on them when you are on the road. This approach can also be used to access your home data from work and vice-versa.
Disclaimer: These steps have worked for me and have been tested on Windows XP Professional SP2. YMMV. I am not responsible for loss of data or damage to computers.
Screenshots for this howto are available here.
Prerequisite
This howto leverages setup from Securing Windows Remote Desktop with OpenSSH. Please ensure you have that setup working correctly.
Install a “Loopback Adapter” (Computer 2)
- Verify that you are signed in as the administrator
- Click “Start”, Click “Control Panel” and then click “Printers and Other Hardware”
- “Printers and Other Hardware” window will open (see screenshot)
- Click “Add Hardware” in left navigation pane
- “Add Hardware Wizard” window will open. Click “Next”
- Wizard will search for new hardware but not find anything
- Wizard will ask “Have you already connected this hardware to your computer?” (see screenshot)
- Select “Yes, I have already connected the hardware” and click “Next”
- On the next screen all the list of existing hardware will be displayed. Scroll to the very bottom and select “Add a new hardware device” and click “Next” (see screenshot)
- On the next screen wizard will ask “What do you want the wizard to do?”
- Select “Install the hardware that I manually select from a list (Advanced)” and click “Next”
- On the next screen select “Network adapters” and click “Next” (see screenshot)
- On the next screen select “Microsoft” under Manufacturer and “Microsoft Loopback Adapter” under “Network Adapter” (see screenshot)
- Click “Next”
- On the next screen wizard will wait for your confirmation. Click “Next”
- Wizard will install the loopback adapter and then display a message indicating Windows has finished installing the software for this device. Click “Finish”
Rename the loopback adapter (Optional step) (Computer 2)
Windows by default will name the loopback adapter similar to “Local Area Connection 2″. This is not easy to identify so it is better to rename it.
- Click “Start”, click “Control Panel”, and then click “Network and Internet Connections”
- Click on “Network Connections”
- Right click on “Local Area Connection 2″ and select Rename
- Change the name to “Loopback Adapter”
Configure the loopback adapter (Computer 2)
- Verify that you are signed in as the administrator.
- Click “Start”, click “Control Panel”, and then click “Network and Internet Connections”
- Click on “Network Connections”
- Right click on “Loopback Adapter” and select properties
- Loopback Adapter Properties window will open.
- Uncheck “Client for Microsoft Networks” and “File and Printer Sharing for Microsoft Networks” (see screenshot)
- Select “Internet Protocol (TCP/IP)”
- Click “Properties” button
- “Internet Protocol (TCP/IP) Properties” window will open
- Select “Use the following IP address:”
- In the “IP address:” field enter 192.168.10.1
- In the “Subnet mask:” field enter 255.255.255.0
- Leave the “Preferred DNS server” and “Alternate DNS server” fields empty (see screenshot)
- Click on “Advanced…”
- “Advanced TCP/IP Settings” window will open
- Click on “WINS” tab
- Select “Disable NetBIOS over TCP/IP” (see screenshot)
- Click “OK”
- You will be returned to “Internet Protocol (TCP/IP) Properties” window
- Click “OK”
- You will be returned to “Loopback Adapter Properties” window.
- Uncheck “Notify me when this connection has limited or no connectivity”
- Click “Close”
The next step might not be required - I had to do this for the Loopback Adapter configuration changes to take effect.
Disable/Enable the loopback adapter (Optional step) (Computer 2)
- Click “Start”, click “Control Panel”, and then click “Network and Internet Connections”
- Click on “Network Connections”
- Right click on “Loopback Adapter” and select Disable
- Right click on “Loopback Adapter” and select Enable
Configure PuTTY (Computer 2)
- Open PuTTY
- In the Saved Sessions list click on the name you created during Securing Windows Remote Desktop with OpenSSH
- Click Load
- In the left pane click on + next to connection
- Click on + next to SSH
- Click on Tunnels
- In the Source port field enter 192.168.10.1:139 (Note: In PuTTY the source port field looks small but it will still allow you to enter details)
- In the Destination field enter the IP (or hostname) and port of the machine you want to connect to. This is the machine you want to map the drive on. (In our example this would be - 192.168.1.120:139)
- Click Add (see screenshot)
- Click on Session in the left pane
- Click Save button (Do not click Load again - it discard the tunnel changes you made)
Connect using PuTTY (Computer 2)
- Open PuTTY (if not already open)
- In the Saved Sessions list click on the name you created during Securing Windows Remote Desktop with OpenSSH
- Click Load
- Click Open
- The first time you connect you will see a security alert. Click Yes. (see screenshot)
- You will be prompted for username/password
- You should be successfully connected to Computer 1 via SSH. (see screenshot)
Map network drive (Computer 2)
- Open Windows Explorer
- Click on Tools->Map Network Drive
- Select the Drive
- In the “Folder:” field enter \\192.168.10.1\sharename (see screenshot)
- Uncheck “Reconnect on logon”
- Click on “different user name”
- “Connect As” window will open
- In the “User name:” field enter 192.168.10.1\username (replace username with a valid user on your machine)
- In the “Password:” field enter the valid password for the user (see screenshot)
- Click “OK”
- You will be returned to the “Map Network Drive” window
- Click “Finish”
- If all went through correctly a new Windows Explorer window will open with the contents of the mapped network drive.
Disconnecting the network drive (Computer 2)
- Open Windows Explorer
- Click on + next to “My Computer”
- Right click the drive letter you had mapped
- Select “Disconnect”
3 Comments so far
Leave a reply






what is the sharename in the map network drive ? .. What we should specify there could you please tell me
sree
sharename is the name you have given to the shared folder to which you are going to map the network drive
-lucidTipster
Thanks for the detailed how to. Very well written! The only thing I would add for anyone out there who have attempted this from work to their home computer and have failed is to host the ssh server over port 443. This port is left open on most corporate networks for outgoing secure http and this is an easier option than having the network group to open up outgoing ports.