Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Setting up Red hat linux VPN

Posted on 2013-11-01
5
551 Views
Last Modified: 2013-12-05
I am trying to setup a red hat Linux server to connect to a windows server running sql server; I want to establish a vpn so DBAs can remotely connect to the windows machine.

Can you help me determine the right VPN client to use and also provide me with the right configuration steps and correct commands to use to set this up.

Thanks,
0
Comment
Question by:redkasote
  • 2
  • 2
5 Comments
 
LVL 34

Expert Comment

by:Seth Simmons
ID: 39618211
what are you trying to connect to?  do you have rras setup somewhere or do you have some other software/appliance?
0
 

Author Comment

by:redkasote
ID: 39618228
I don't have any software setup or rras. I attempted to intall pptp as a VPN client but wasn't successfull. I am trying to connect to a windows server from a red hat box.
0
 
LVL 13

Expert Comment

by:Daniel Helgenberger
ID: 39618651
Please note, you do not necessarily need a VPN for your setup but can do the same thing maybe better and much easier with ssh port redirection:
1. the client connects to the ssh server
2. the client opens a random port on its own loopback terminated on the servers SQL port
3. access to the loopback port is forwarded through the ssh tunnel to the server's SQL port.
4. the SQL client accesses the the SQL server via its own loopback interface

If you cannot achieve this, for instance because you have no terminated/direct connection to the windows server from your redhat client, I would recommend OpenVPN. This is quite easy to setup and very secure. Binaries are readily available for both OS's.
0
 

Author Comment

by:redkasote
ID: 39618675
I am able to ping the sql server from the red hat machine, is that a direct connection? I started to setup openVPN but there aren't any properly put together steps online. I wasn't sure if I had to setup the openVPN server steps as well or just skip to the client. The steps I was referring to went through server configuration and then client setup.

Are you able to give me the steps to setup both solutions or direct me to where I can see good instructions.  Thanks.
0
 
LVL 13

Accepted Solution

by:
Daniel Helgenberger earned 500 total points
ID: 39619885
Please have a look at this tutorial, to setup OpenSSH on windows:
http://comptb.cects.com/1264-install-configure-ssh-on-windows

If this is configured and setup correctly, then initialize an SSH port forward on your linux client like this example (please change it to your needs):
ssh -N -L31433:localhost:1433 user@winserver &
# Lets test this:
telnet localhost:31433

Open in new window

Explanation:
This assumes, you have a valid user named 'user' on your windows server named 'winserver' and MS SQL running on tcp/1433 on 'winserver'. Please change these settings to your needs.

The port I used, 31433, is random, you can use any other port you like. High port numbers are used commonly (since they require no su rights and do not interfere with other services).

Then, change your connection settings in your Linux application to access the SQL server via localhost:31433
Further, I use -N, this prohibits remote command execution, and & to run this process in the background. The telnet command is just a quick test if the tunnel is up. You should not get a timeout, though any other error is fine in this case.

Note, if this works, you can easily setup xinetd to establish the connection on demand or use a custom service to have it always open. Also, use ssh-keys so services can connect to your windows SSH server, as covered in the HowTo. Also, as a security precaution, you should setup a port forward/guest only user with no remote command execution permissions on your windows server.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Let’s list some of the technologies that enable smooth teleworking. 
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question