Posts tagged ssh
SSH TUNNELING
Nov 2nd
Downloads
-Putty
-OpenSSH
-VNC
Home Machine
Step 1
Install OpenSSH on your home machine. Once installed go to the OpenSSH Directory (c:\ Program Files\OpenSSH) and follow the quick start guide in the Docs folder.
Step 2
Once you have created your group and password file go to the Bin directory and open SSHD_CONFIG (not ssh_config) in word pad.
Uncomment the line # Port 22 and change the port number to 443 (this discuses the traffic as normal https traffic)
Also uncomment # AllowPortForwarding Yes (make sure it is set to YES)
Close and save.
Now configure your router to allow port forwarding. Go to the port forwarding set in your routers config and set it to forward all 443 TCP traffic to the nat’d IP of your home PC. E.g. 192.168.0.4
Work PC
Step 1
Download and configure Putty
- Under the session tab enter the external IP of your home pc – this will be the router’s IP – you can get this from going to status or something of the like on your router. This should not be a 192.168 address. Enter the port as 443 (this is going to fool the proxy).
- Next set the protocol to SSH.
- Now go down under Connections and pick your proxy type (I used http, but you may want to pick something else if you are behind a socks proxy). Enter in its hostname and port. If you don’t know what this is check the proxy settings for your web browser, this should give you all the information you need. It’ll probably be 8080.Under the SSH tab set the protocol for version 2 and move AES encryption up to the top with 3DES below.Now under the SSH tab, click on Tunnels – this part gets a bit confusing. Source port is the port on your work computer you want to forward over the tunnel and destination should be localhost:port. This is because when your home computer gets the forwarded packets, it will forward it to localhost:port – which will be homeComp:port – exactly what we need. This is also interesting, because we could set it up to forward to a 3rd machine, I’ll leave that one up to someone else with some good ideas. When your done, click add and you should have something like “L5900 localhost:5900” – I set up this forward so I can use VNC from workComp to connect to homeComp.
- Remember to save your session, up on the main session tab, as it is quite annoying have to type all these settings in every time you start up putty.
Tunneling through your own proxy
Install a proxy on home PC (ProxyPlus/SQUID)
Add tunnel in putty
Source port: ProxyPortNumber (eg 3333)
Destination: 127.0.0.1:3333
Do the same for your proxies config.
Point the your proxy server address as 127.0.0.1:ProxyPortNumber
Proxy goes over the tunnel made by putty to home pc on what port you chose.
File sharing through your SSH Tunnel
http://souptonuts.sourceforge.net/sshtips.htm
Step 1 – Create a loopback network adapter
Control panel > Add Remove Hardware
1. Yes, I already connected the hardware
2. Add a new hardware device (bottom of menu)
3. Install the hardware that I manually select from a list (Advanced)
4. Select Network Adapters
5. Micosoft Loopback Adapter
Step 2 – Configure the loopback adapter
– Asign the loopback adapter the IP 10.0.0.1 and the subnet 255.255.255.0
– Leave default gateway and DNS blacnk
– Go to advanced
– In IP settings tab set the metric to 9999
– Go to the WINS tab
- Enable LMHOSTS
- Disable Net Bios over TCP/IP
Step 3 – Configure putty
- Go to tunnels and add
- Source port: 10.0.0.1:139
- Destination: IP ADDRESS OF HOME PC (192.168.0.4)
- Click add then go to sessions and save your new settings
Step 4 – Connect
- Go to start -> Run and enter \\10.0.0.1
Step 5 – Share permissions
You may get errors on newly created shared folders. To get around this:
- Right click on the folder
- Select Properties
- Go to the security tab
- Press add
- Type Everyone, click check names and OK
- Tick Full control
- Apply and OK