|
Private Access to an SSH-Secured SMB
Share
This set of steps should
be followed by those wanting to set up a secure tunnel to an SMB
share and to only be able to access the share from the same computer
®.
- Configure the local network interface such that NetBIOS over
TCP/IP is enabled. If you have to change this
setting from Disable to Enable, a reboot
is required for this to work. If you have modified this value
recently and have not rebooted, a reboot would be a good idea
- From the Control Panel, select Network and Dial-up
Connections (on Windows 2000) or Network Connections
(on Windows XP); right-click on Local Area Connection
and choose Properties.
- Select Internet Protocol (TCP/IP) and click
on the Properties button.
- Click on the Advanced button and navigate to
the WINS tab.
- Select Enable NetBIOS over TCP/IP. If this option
is not already selected, close all
dialogs using the OK button and reboot the machine.
If this option is already selected, you may want to reboot
anyway.
- If your environment does not require you to
leave File and Printer Sharing installed, remove the File and Printer Sharing components for Microsoft Networks:
- From the Control Panel, select Network and Dial-up
Connections (on Windows 2000) or Network Connections
(on Windows XP); right-click on Local Area Connection
and choose Properties.
- Select the File and Printer Sharing for Microsoft
Networks and click on the Uninstall button.
When prompted with Are you sure...?, click on
the Yes button, and close the Local Area
Connection Properties dialog.
- If your environment requires you to leave File and Printer
Sharing installed, disable Direct Hosting (the
service on port 445):
- Start the registry editor.
- Locate and then click on the following registry key:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NetBT\Parameters
- Add the following registry value:
Value Name: SmbDeviceEnabled
Type: REG_DWORD
Value Data: 0
- Reboot the machine.
- Create a session in SecureCRT that will connect
to the remote SSH server and will forward from 127.0.0.1, port
139 to the remote SMB server.
- Fill in the hostname/IP address and port of the SSH server
to which you will be connecting.
- Navigate to the Port Forwarding category.
- Enter the name of port forward entry (for example, SMB).
- In the Local section, check the Manually select local
IP Address on which to allow connections option and
specify this address as 127.0.0.1 (this could also be something like 127.0.0.2 or 127.0.0.3, etc.)
- In the Remote section, check the Destination host
is different from the SSH server option and enter the
hostname or IP address of the SMB server relative to the SSH
server. For example, if the SMB shares exist on the same machine
as the SSH server, enter the name of this machine.
NOTE: The
IP address or name entered here cannot be localhost
or 127.0.0.1 (or any other 127.x.x.x) because the SMB service
does not accept connections on the loopback interface.
- Before exiting SecureCRT, navigate to the Global
Options dialog in the Options
/ Advanced category).
- Select the Configuration folder path entry and copy
it to the clipboard.
- Exit SecureCRT, browse to the Configuration folder
(which should already be in the clipboard).
- Edit the newly-created session's .ini file to allow requests
from all addresses. Note that while this initially does not seem
secure, in reality—as long as this particular session only
has one port forward entry (create another session to forward
any other traffic such as IMAP, for example) this will only be
accessible to the local machine since no other machine will be
able to access the 127.0.0.1 loopback address (where SecureCRT is listening).
Remember, SecureCRT must not be running in order to
successfully edit the session's .ini file. The line in the session's
.ini file should be changed to:
S:"Port Forward
Filter"=allow,0.0.0.0/0.0.0.0,0
This step is necessary
because Windows seems to always set the external IP address of
the machine as the source address when making the connection.
- Save the .ini file and exit the editor.
- Start SecureCRT and connect to the SMB-forwarding
session.
- Once connected with SecureCRT, start Windows Explorer
and in the address bar, type:
\\127.0.0.1
and press ENTER to
browse the shares available on the remote SMB server. Or, you
can use Tools / Map Network Drive and specify the following path:
\\127.0.0.1\SHARE_NAME
Was this information helpful?
|
|