Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

This is embarrassing for me, but I have no idea what to do. I want to connect to SQL server from my home and field office; what else should I tweak? I could use VPN (it works), but I* prefer to connect directly. My admin is on vacation and I'm starting to appreciate his work even more.

Facts:

SQL Server 2008 R2: All services are running Mixed authentication is enabled TCP/IP protocol is enabled

OS: Windows Server 2003 SP2

Please help.

P.S. I've restarted my machine after applying changes P.P.S. I am aware of security risks, my manager... you know the drill.

share|improve this question

migrated from stackoverflow.com Aug 29 '11 at 13:08

This question came from our site for professional and enthusiast programmers.

2  
I'd love to see the look on your admin's face when he returns and sees what you did to his server. –  Joel Coel Aug 31 '11 at 3:09
    
if VPN works- wth are you thinking about putting on the public internet?? –  AliGibbs Sep 16 '11 at 11:58

4 Answers 4

up vote 23 down vote accepted

First, don't allow access to your SQL Server from the public Internet. The is the quickest way to get someone to break into your SQL Server.

Personally if I was the sysadmin at your shop and found that you had exposed the SQL Server to the public internet while I was away so that you didn't have to bother to VPN into the network, I'd have your ass fired as soon as I got back and found out about it.

Based on the question that you have asked it's clear that you aren't the sysadmin which means you aren't the one responsible for the network security so you sure shouldn't be screwing around with it while he's on vacation.

share|improve this answer
1  
I agree with you, but you don't sign my paycheck. I will send link to your answer to my manager. –  Deka Aug 29 '11 at 14:54
3  
Deka - if the VPN works, and that's the approved method of access, why are trying to mess with it? –  mfinni Aug 29 '11 at 15:56
    
I've decided to make option to connect via VPN programmatically, but still out the pathological curiosity some day I'll try to expose server to the internet. One way or another. :) –  Deka Aug 29 '11 at 22:00

VPN. If you upgrade your work environment to Windows Server 2008 R2 then you could connect instead with DirectAccess which makes the intranet transparently visible from any location and you'd work from home just as you would do from office, as long as your machine is authorized.

share|improve this answer
    
I haven't had opportunity to work with Windows Server 2008, but it sounds promising. Thanks. –  Deka Aug 29 '11 at 22:03

A VPN (may) be the easiest thing depending on your network configuration. SQL Server normally operates on port 1433 (minimum, other features use different ports), so you'll need to make sure that port is allowed inbound access on your firewall.

Secondly, if you are NATed - you'll need to forward the port to your machine.

If all of this is beyond your control due to network policies, a VPN tunnel is a good solution, and in most circumstances, has several security advantages such as encryption. SQL Server does not encrypt traffic (by default).

share|improve this answer
    
I've made exceptions in firewall. –  Deka Aug 29 '11 at 13:29
    
@Deka - Are you NATed? –  vcsjones Aug 29 '11 at 13:37
    
I've forgot sqlBrowser exception... As I know (and it looks like I know very little about current system settings) we didn't apply NAT (Network Address Translation, right?). –  Deka Aug 29 '11 at 13:50
9  
Putting a SQL Server on the Internet is an incredibly bad idea. –  mrdenny Aug 29 '11 at 14:27
    
@mrdenny is right, up-voted this answer as if the OP is adament they want to expose it to the Internet then answering how to do that doesn't deserve to be penalised! –  Joel Mansford Aug 29 '11 at 23:53

Port 1433 is probably behind a firewall, so you have to go into windows firewall > advanced to open the port by creating a new rule to open that port, Local Port > TCP 1433. But make sure, you set up a Scope (IP Range) on it at least if you do open it for security reasons, there are additional measures you can take as well to increase security. Only allow access to this port from people granted from YOUR ip address (www.whatismyip.com).

Make sure your ISP Router allows has this port open to the public and routed to the server with SQL on the router configurations.. If its a hosted site already, then nevermind that.. unless they have it blocked behind a firewall as well, which most usually dont'.

Once this is done, all you need to do is make sure your SQL server Main Instance Properties > Connections and say 'Allow remote Connections'

then you're set, you should be able to connect to the database, but using the credentials you should already have.. If you don't have the credentials, it's probably not a good idea for you to mess around creating a new user and mapping it to the proper db etc.. you may restrict access to your own website messing around here..

When connecting remotely, you just put in an ip address, and it usually asks you which db you want to connect to, the db's it allows you to with that users granted access.. You should have it from here..

share|improve this answer
    
I've done that as well. Only later I've realized I had several obstruction, including router etc. –  Deka Sep 7 '11 at 10:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.