How to connect / tunneling to another computer to use it's localhost?
If computer A is reachable via SSH, an SSH tunnel would be indeed the way to go:
computer-B$ ssh -L 1234:localhost:80 computer-A.example.com
Once you're logged in, point your browser to http://localhost:1234
and the webserver on computer A should respond.
With putty, there's a "Tunnels" menu underneath the "SSH" option (left side) where you can configure the same forwarding.
Update: While virtually all Linux distributions are shipping an OpenSSH server, Windows operating system has no such thing by default. There are however SSH servers for Windows available. Once the SSH server is running on computer A (and port 22/TCP is forwarded to that computer, if it's behind a router), you can use the example above to finally connect to computer A either via command line or via a graphical SSH client, like Putty.
Related videos on Youtube
aspirinemaga
Updated on September 18, 2022Comments
-
aspirinemaga over 1 year
I'am not quite sure how to describe what I really asking for, so i will try:
I have two computer A and B.
Computer A is my primary computer I'am working on. I'am web developer, and as you may know, I'am using XAMPP / WAMP applications to deploy a server Apache/MySQL/PHP etc... so I can use:
http://localhost
andhttp://127.0.0.1
to access my websites on localhost machine.Now at the moment, I'am not at home, currently on Computer B. I would like to access Computer A from Computer B so I can use
http://localhost/
adresse on Computer B to access the websites I've been developing on Computer A.I remember someone told me something about tunneling throught SSH (i.e. in PUTTY), but I'am not sure how to do it. So I would be really glad if someone could give me a hand on this.
Thanks
==== UPDATED ====
Configuration on both computer are the same: OS Windows 7 64bit.
==== UPDATED 2 ====
Both computers are accessible with public IP addresses.
-
aspirinemaga over 10 yearssorry, forgot about it. updated
-
-
aspirinemaga over 10 yearsI have installed OpenSSH server on A, and OpenSSH Client on B. There is no such a command line where I can apply your code. I tried to connect but it's not responding to the IP. IP is correct, ports forwarded to 22, 23, 80 to comp A. Any suggestion ?
-
ckujau over 10 yearsNow with your updated description (Windows OS on both ends), let me emphasize my first sentence: "If computer A is reachable via SSH" :-) If you don't have an SSH server installed on computer A, SSH tunneling won't be an option for you. One could still use a VPN solution, but this may be even harder to set up properly.
-
aspirinemaga over 10 yearsI've updated my question. Pls could you modify your answer depending on my computer's IP adresses ? thank yoi
-
davidbaumann over 10 yearsForwarding port 80 makes your development enivronment accessible to the internet, which I absolutely don't recommend!
-
aspirinemaga over 10 yearsthanks, will try to find more about that teamviewer vpn. btw I can't switch to linux at themoment, but thinking about it already.
-
davidbaumann over 10 yearsYou can switch, and run your old apps in virtualbox - maybe. I switched and don't miss the time running 12 installers to update my system after 2 weeks.