LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-05-2010, 12:20 PM   #1
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Rep: Reputation: 30
Ssh vpn


Is there a way to use putty SSH to create a VPN connection to my linux server so that I can connect my windows xp laptop through my Linux box's IP?
I've tried installing all the usual OpenVPN freebies and they are not working or users on the site's have little troubleshooting experience with them so we are both stuck.
I just need a simple 1 to 1 user solution for the moment
 
Old 01-05-2010, 12:28 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
You'll never get an actual VPN, but you can do port forwarding over SSH just fine, either statically, or using a socks proxy. With a socks proxy setting any client tool which can use a socks proxy can implicitly connect anywhere that that remote point can reach.
 
1 members found this post helpful.
Old 01-05-2010, 12:28 PM   #3
raj.darkmystery
LQ Newbie
 
Registered: Oct 2009
Posts: 28

Rep: Reputation: 15
if you want to connect to XP through Linux machine, you can simply use "rdesktop" no need to search for extra softwares or tools, its installed with normal installation of linux
 
Old 01-05-2010, 12:29 PM   #4
Web31337
Member
 
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Blog Entries: 71

Rep: Reputation: 65
you can allow forward ports on your ssh server and use putty to create tunnel to your laptop's ports.
lots of easy howtos are there if you just google for "putty ssh tunnel", like http://people.hmdc.harvard.edu/~mathpre/vnc/putty/ , many others. I use putty ssh tunneling when connecting to my home server to access VNC, as i don't allow it to listen on external address, it is bound to 127.0.0.1.
 
Old 01-05-2010, 01:08 PM   #5
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by raj.darkmystery View Post
if you want to connect to XP through Linux machine, you can simply use "rdesktop" no need to search for extra softwares or tools, its installed with normal installation of linux
It's more that I want to run software on my Windows laptop but tunnel it through the Linux server so that instead of having the WAN IP, I get the ge specific IP address of the Linux box...
rdesktop sounds like a remote desktop connection ?
 
Old 01-05-2010, 01:09 PM   #6
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Web31337 View Post
you can allow forward ports on your ssh server and use putty to create tunnel to your laptop's ports.
lots of easy howtos are there if you just google for "putty ssh tunnel", like http://people.hmdc.harvard.edu/~mathpre/vnc/putty/ , many others. I use putty ssh tunneling when connecting to my home server to access VNC, as i don't allow it to listen on external address, it is bound to 127.0.0.1.
Do I need to know every port running on my laptop to tunnel it through to the linux box?
I really only wanted to open one port on the server for security as the box is already used as a proxy server.
 
Old 01-05-2010, 01:17 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
only the ports that are relevant, but if the only reason is to reach a web proxy, then the socks option might suit you better, avoiding the need for the dedicated proxy completely.
 
Old 01-05-2010, 01:28 PM   #8
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by acid_kewpie View Post
only the ports that are relevant, but if the only reason is to reach a web proxy, then the socks option might suit you better, avoiding the need for the dedicated proxy completely.
Well, the web proxy serves clients for website requests.
I just want to utilise the server for a temporary connection myself but for 1 bit of software on my computer. I can't be sure what ports it uses though or whether it opens new ones as needed.
 
Old 01-05-2010, 03:56 PM   #9
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by acid_kewpie View Post
only the ports that are relevant, but if the only reason is to reach a web proxy, then the socks option might suit you better, avoiding the need for the dedicated proxy completely.
This client doesn't have anywhere to set proxy or SOCKS proxy settings sadly.
Ok, so this program uses ports 17326, 17325, 443, and 80.
So I need to create a tunnel for all those ports an dopen those ports on the server if not already open?
WHat if port 80 and 443 are already being used on the server by the proxy?

On a separate note, I used this proxy server before but had a problem with video site using Flash's new RTMP on port (I think) 1935. This is because the browser would route everything through port 80 and proxy settings yet 1935 went to a direct connection rather than through the proxy. Could I re-tunnel that back through the proxy using SSH?

Last edited by qwertyjjj; 01-05-2010 at 04:09 PM.
 
Old 01-06-2010, 02:01 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Right so yes you'd need 4 tunnels if those details are correct. it doesn't matter what ports are being used on the remote machine, it's the loopback interface on the local one which they bind to.
 
Old 01-06-2010, 02:53 AM   #11
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by acid_kewpie View Post
Right so yes you'd need 4 tunnels if those details are correct. it doesn't matter what ports are being used on the remote machine, it's the loopback interface on the local one which they bind to.
So, I could open port 2000 on the server.
Then I forward those 4 ports on my local computer through SSH to the server and all traffics is now running through those ports.
Problem is do I need those 4 ports open on the outgoing firewall on the server?

ie
Normal connection: client to software developer's server 80, 443, 17326, 17325
SSH connection: client to Linux on 80, 443, 17326, 17325.
Linux now needs to connect to the software developer's server, it can't do that all through port 2000 can it?

I tried this with port 80, but when SSH connected to the server, it just hung.
Do I need to use a username and password as well?

Last edited by qwertyjjj; 01-06-2010 at 02:59 AM.
 
Old 01-06-2010, 10:29 AM   #12
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
No, the point is that the only port you need for the tunnel is 22, the other ports are only used within the client machine and then passed over port 22 and out to their destination at the server side, of course you need to have a functional SSH session running in order to bind the ports at the remote server end. what is required of the network after it leaves the ssh tunnel is none of SSH's business. I don't understand where port 2000 comes into the equation at all.
 
Old 01-06-2010, 10:59 AM   #13
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by acid_kewpie View Post
No, the point is that the only port you need for the tunnel is 22, the other ports are only used within the client machine and then passed over port 22 and out to their destination at the server side, of course you need to have a functional SSH session running in order to bind the ports at the remote server end. what is required of the network after it leaves the ssh tunnel is none of SSH's business. I don't understand where port 2000 comes into the equation at all.
Does it need a username and password to connect?
I can't seem to enter that in putty.

2000 was just an assigned port instead of using 22 for SSH to listen to.

Sorry, what I meant was that if my local 17326 port gets sent to the server on port 22, then out to the developer's server. The developer's server will be expecting a connection from port 17326 and also reply on that port but the Linux server has port 17326 closed.
 
Old 01-06-2010, 11:02 AM   #14
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
from port 17326? no, the destination is whatever you tell putty to redirect to. e.g. you'd map 1234:23.45.67.89:6789 meaning that connections hitting 1234 on the local machine will go down the ssh tunnel, and be sent on to 23.45.67.89:6789 when they emerge on the ssh server.

Last edited by acid_kewpie; 01-06-2010 at 11:03 AM.
 
Old 01-06-2010, 11:19 AM   #15
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by acid_kewpie View Post
from port 17326? no, the destination is whatever you tell putty to redirect to. e.g. you'd map 1234:23.45.67.89:6789 meaning that connections hitting 1234 on the local machine will go down the ssh tunnel, and be sent on to 23.45.67.89:6789 when they emerge on the ssh server.
yes but then the ssh server send it onto 89.111.222.34 and expects a reply on the same port?

Let's assume MSN runs on port 234.
I route 234 to the SSH server on port 22.
The SSH server has outgoing port 234 open so it routes the connection on 234 to Microsoft. Microsoft reply on port 234 but it can't because the incoming port 234 is blocked on the SSH server.
Is that how it works? Because if so, then I need to open all related ports.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH vs VPN maxsanders Linux - Networking 3 08-14-2007 03:22 PM
VPN vs SSH metallica1973 Linux - Security 4 06-06-2007 10:25 AM
SSH -2 as secure as VPN? Lexia Linux - Networking 1 02-23-2007 03:24 PM
VPN, SSH and VNC roofninja Linux - General 2 04-06-2006 01:27 PM
ssh + vpn = right choise? spoody_goon Linux - Networking 7 01-07-2006 02:47 PM


All times are GMT -5. The time now is 10:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration