Link to home
Start Free TrialLog in
Avatar of Optima Systems
Optima SystemsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Unable to allow external remote connections to SQL database

I have to allow remote connections to this database so their web guy can setup a link into the database to display specific data on their website. I must also add I'm not overly familiar with dealing with SQL databases.

I can remotely connect to the database internally but I have been unable to get this to work externally. Their Firewall is configured to block all SQL connections except those from specific static addresses. I have applied all necessary rules to allow the connection to happen.

When I attempt to connect to the database remotely I seem to get 2 varying error messages, when connecting to just the IP address it says "Login failed for user. (Microsoft SQL Server, Error 18456)" and when connecting to IP\DBname it says "Instance failed (System Data)". Searching online hasn't yielded any results. As far as I can tell all the SQL settings are set to allow remote connections and given they work internally I believe this is correct.

I also receive the following error "A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted) (Microsoft SQL Server)". I can get around that error by going into Options and ticking "Trust server certificate". So I'm not sure whether this error has any relevance to my issue.

I have tried logging in using AD credentials and an SQL user both with full admin rights without any luck.

Any help would be appreciated.
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

The simplest test would be from an external IP to telnet to SQL server port
Avatar of Optima Systems

ASKER

Hi John,

I am able to connect via Telnet on port 1433.
Are you using Windows authentication ?
Try with SQL credentials
Hi John,

I have tried with both and get the same result.
When our web guy tries to connect from a Linux environment he gets the following error:

tsql -S "IP:1433" -U "Username" -P "Password" -D "Database"
locale is "LC_CTYPE=en_GB.utf-8;LC_NUMERIC=en_GB.utf-8;LC_TIME=en_GB.utf-8;LC_COLLATE=en_GB.utf-8;LC_MONETARY=en_GB.utf-8;LC_MESSAGES=en_GB.utf-8;LC_PAPER=C.UTF-8;LC_NAME=C.UTF-8;LC_ADDRESS=C.UTF-8;LC_TELEPHONE=C.UTF-8;LC_MEASUREMENT=C.UTF-8;LC_IDENTIFICATION=C.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Setting Database as default database in login packet
Msg 18456 (severity 14, state 1) from APP-2 Line 1:
        "Login failed for user 'Username'."
Error 20002 (severity 9):
        Adaptive Server connection failed
There was a problem connecting to the server
To add onto this, when checking logs the failed attempts appear as
"Login succeeded for user "DOMAIN\SERVERNAME$". Connection made using integrated authentication. [CLIENT: <local machine>]"

The username is not what we're signing into, I'm not sure how it's grabbing the domain and the server as opposed to the actual username.

When signing in internally form a remote machine it appears as the correct user and the correct client address.
"Login succeeded for user "Username". Connection made using integrated authentication. [CLIENT: IP Address]"
ASKER CERTIFIED SOLUTION
Avatar of Optima Systems
Optima Systems
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial