Connecting Through Remote Desktop Gateway - remote-desktop

From my laptop outside of office, I need to (RDP) connect to a server in the private subnet through remote desktop gateway (RDGW) server in public subnet.
Here is my RDP setting on my laptop:
Gateway settings tab:
Use a TS Gateway server: Checked
Server Name: Public IP address (54.21.24.11)
By pass for local addresses: Unchecked
Share Gateway .....: Checked and username, password and domain entered
Server Settings tab:
Server Name: Local IP address of server in private subnet (10.0.0.10)
It takes longer than normal to connect and at the end it errors out with message remote server is not accessible. User name, password and domain are all fine but somehow I can't get connected to 10.0.0.10.
Everything works if I first RDP to 54.21.24.11 and from there RDP to 10.0.0.10.
I did many different settings but the result is always failure in connection.
Am I doing something wrong?
Thanks

Found the problem. It was due to the port 443 (HTTPS) being closed on the RDGW server. I opened the port and added a trusted certificate. Everything works now.

Related

Remote PostgreSQL connection from external client on Windows

i am trying to connect to a PostgreSQL DB which is hosted on Windows 10 machine.
I have changed the following settings on ini file:
listen_addresses = '*' is set in postgresql.conf
host all all 0.0.0.0/0 md5 is set pg_hba.conf
I have enabled the 5432 port for TCP/IP connections and I have checked that it is listening.
Results:
IT WORKS when I try to connect to the DB from a machine that is under the same network as the machine hosting the server using the private IP for connection
IT DOES NOT WORK when I try to connect to the DB from a machine outside the network of the machine hosting the server, using the public IP for connection
I have seen several topics about it, but the only suggestions are to modify init file and add a rule to open TCP/IP on 5432 port.
Could you please help?
thanks!

Accessing SQL server residing on AWS through application on local machine

I have SQL server 208 R2 hosted on AWS. Can I access that SQL server through my web application on local machine without VPN?
What connection string we need to give in web.config. So I no need to have SQL server on my local machine.
I can run and test my application without having SQL server on my local machine.
If your SQL Server is publicly accessible, then you can simply connect directly to it. It's a bad practice to expose database servers directly to the internet, however, so don't do this.
If your SQL Server is not publicly accessible, then you can connect to it via an SSH tunnel. You would launch a publicly-accessible EC2 instance, restrict its security groups to allowing SSH from your local IP address, and then use SSH on your local machine to port-forward to the SQL Server via the SSH tunnel. You can then connect your database client to the local port on your machine and that will be forwarded to the SQL server via the SSH tunnel. Here's an example.
The SQL Server will also have to allow inbound connections from your EC2 instance.
Assuming it's the default SQL Server instance listening on port 443, and your EC2 instance has a public IP address, you could do the following:
Enable access to your EC2 instance through port 443 from your local machine public IP.
Configure Windows firewall to allow access through port 443
Ensure TCP/IP protocol is enabled for your SQL Server Instance
Use data source=<the public ip address of your E2 instance> in the connection string.
To enable access to your EC2 instance through port 443 from your local machine public IP do the following:
Go to AWS mangement console.
Go to EC2 Service.
Click on Running Instances
Click on your EC2 instance running SQL Server
Click on one of the security groups listed on the Description tab.
Click on the Inbound tab.
Click on the Edit button
Click on Add Rule button
Select Custom TCP rule on the Type dropdown list.
Enter 443 on Port Range.
Select My IP on Source dropdown list.
Enter "SQL Server from My local IP" on Description text box.
Your public IP address might change over time, so you might need to update the source when this happens.
To configure Windows firewall to allow access through port 443 open an RDP session to your EC2 instance and use Windows Firewall with Advanced Security tool and add the the rule.
To ensure TCP/IP protocol is enabled for your SQL Server Instance do the following:
Open an Remote Desktop session to your EC2 instance.
Open SQL Server Configuration Manager.
Expand SQL Server Network Configuration
Click on Protocols for
Enable TCP/IP protocol if not enabled.
Hope it helps

Unable to connect to remote SQL Server database from local management studio

I have purchased a VPS from GoDaddy. I installed SQL Server on the VPS through remote desktop connection and could connect to the database. Login credentials used are ServerName:IPAddress, Username=sa; Password=****
However when I tried to connect to the remote database from my local machine I am getting the error as
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
I have cross checked the following scenarios
Made sure that TCP/IP is enabled
Made sure that SQL Server Browser is running
How can I solve this issue ?
You may have to add the IP address of your local machine to the server. Setting the IP to accessible. For security reason, it is not allowed to access the server for all the host except the host with the IP address that was added to the whitelist.
You can find the instruction in this web page.
From the web page:
If you want to connect remotely to a database, you must enable
support for remote connections.
Log in to your GoDaddy account.
Click Web Hosting.
Next to the cPanel account you want to use, click Manage.
In the Databases section, click Remote MySQL.
In the Host field, enter the IP address from where you want to access your databases.
Click Add Host.
What to enter... Host Name or Server: Your database's host
name Port: 3306 Username: The database user's username
Password: The database user's password Database: The name of the
database

Diagnose SSMS connection issue with Azure VM

I created a virtual machine and install our own copy of MS SQL2016. I can connect fine from the VM but when I try to connect from outside (my office) it say that it cannot find the network instance. I have tried the Server name (Mapped in host file) the DNS name connected to the public IP and even the public IP. I have enabled the TCP/IP protocol and set the port (1433), set up a Windows firewall rule, set up incoming rule in Network security group, read articles and tried many things but still same message .

Anyone have an idea?

Unable to connect to SQL Server 2014 remotely

Unable to connect to SQL Server remotely
I have installed SQL Server 2014 Express on Windows 10. I can connect to server locally by entering: computername\SQLEXPRESS or 192.168.0.xxx\SQLEXPRESS
When I try to connect to the server using public ipadress
122.xxx.xxx.xxx\SQLSERVER
I get an error:
Error: 26 - Error Locating Server/Instance Specified) (.Net SqlClient
Data Provider)
I also have host name from dlinkddns, tried connecting with host name with same error.
Steps which I have tried:
Enabled remote connections.
Configured 1433 TCP port to be allowed in firewall. Disabled antivirus program. I tried disabling firewall with no success.
Enabled all protocols "TCP/IP', 'Named Pipes', 'Shared memory'
Under TCP/IP properties, changed 'IP All' 'TCP Port' to 1433. I tried enabling IP1 to public ipadress with port 1433 with no success.
I have dlink DIR 816 router, i dont see anything called port forwarding instead it has 'port triggering', i configured to allow port 1433 TCP and 1434 UDP.
I can ping both ipadress and hostname with success but the server would not connect.
I have tried everything to the best of my knowledge but nothing works, any inputs to setup my connection remotely will be of great help!
The error is pretty specific here.
error: 26 - Error Locating Server/Instance Specified (.Net SqlClient Data Provider)
You must understand one thing. Your local IP (192.168.0.xxx) is not visible from WWW. Only your Public IP or Global IP is. Once someone comes inside your network they will be able to ping your IP (192.168.0.xxx).
To make it work, you must have the SQL Server installed in a computer whose local IP is accessible from the internet. That means, it should be hosted in a Domain.
Connecting to SQL Server over the Internet
We can connect to SQL Server remotely over the internet if the Server has a static public IP address and port forwarding is configured on the router to allow remote connection requests through the router firewall.
In the router firewall settings, there is normally a games and application section, in there add SQL application and give the port range (1433 normally) and then direct the incoming connection by selecting the SQL Server device name on the network.
I fixed the issue by adding local ip into DMZ on my router. Everything works like a charm now.

Resources