SSH-yhteys ja jaettu kansio

eero
Site Admin
Viestit: 329
Liittynyt: 07 Marras 2007 20:17

SSH-yhteys ja jaettu kansio

Viesti Kirjoittaja eero »

Map network drive over SSH

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
    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.
    You will be prompted for username/password
    You should be successfully connected to Computer 1 via SSH.

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
    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”