SSH remote takes too much time to connect - vscode-remote

My local is Windows 10 and host is Linux (AWS EMR).
Using key based authentication.
I need to connect to linux machine for my dev work. Every time I connect to remote, it looks like it setups the VS Code Server everytime and it takes a lot of time each time I connect.
How can I prevent VS Code to setup itself each time I connect?
what it shows when connecting to remote
Thanks in advance!

I figured out something. It was a .ssh/config file issue on host system.
I reverted it to vanilla (bare minimum configs) and it was smooth after that.

Related

Oracle database 12c Error while trying to connect: The Network Adapter could not establish the connection

I installed Oracle database 12c for the first time. I followed correctly all the steps and installed it on Windows 7 64 bits, but when I click on SQL Developer and try to create a new connection, I put in the informations like Username and password, and finnaly click on TEST button, I get this error message: "The Network Adapter could not establish the connection".
I dont know what to do anymore, I read tutorials and cant solve that error. Also, when I open SQL Developer, i get a message saying Im using a java version that is not supported by Oracle Database, Im using java 1.8 and it says I should use from 1.6 to 1.7 only. im not sure if that is causing something bad but it seems fine because I can go further using the SQL Dev. So, what should i do? Thank you very much!
Here are some things to check:
Ensure that the TNSNAMES.ORA file is properly configured to reference the database. Check for the SID, host name, and port number (typically 1521).
Check whether you can connect directly from the server, such as with SQL PLus. This should isolate whether it's a server or client problem.
Ensure that the Listener service on the server is running. Check that LISTENER.ORA is properly configured.
I encountered a situation in the past where client PCs could not connect. I found that by deleting (or renaming) the SQLNET.ORA file, the connection could be made.
Good luck.
Execute
tnsping <db_name>
from command prompt.
You will see, if listener is running and tnsnames.ora is configured properly.
Run with Windows PowerShell or Command Prompt (Admin) :
lsnrctl start

Retrieving data from SQL Server over VPN with PYMSSQL

So, I'm trying to use pymssql to connect to a SQL Server database from my Linux box. The database can only be reached from inside my company's private network. It is set up to accept SQL Server authentication and, from my windows machine, I am able to connect and query it when I am logged on to the VPN (Cisco Anyconnect is the client installed on the Windows box).
The python script works correctly when run on a linux machine that is plugged into the internet at work. I haven't tried it on my windows machine (because, right now, I have no python on that machine, for one).
On my linux machine at home, I have downloaded OpenConnect, which seems to be working fine for establishing a VPN connection. When I run my script from this machine, while on the VPN, I successfully connect to the database. If the test query I use in the script is to creat a table, or manipulate data in the database, it works. However, I am not able to RETRIEVE any data, i.e., if I run a select query, I get [].
(Also, it is perhaps worth mentioning, that the first thing I tried to do, before figuring out how to get a VPN client on my linux machine (at first I was messing around with Cisco stuff which was a nightmare), was to ssh from my windows machine inside the private network to my home linux machine while forwarding a port from my home linux machine to 1433 on the SQL Server machine. Then instead of using pymsswl.connect() to connect to the SQL SERVER machine, I connected to my local port. I observed the same behavior, actually, in this case as over the VPN. I wasn't particularly surprised that I couldn't get data back in that case, since it's overwrought, and I could see SQL Server not knowing where to send the data....although I am really just speculating there anyway...)
I should also mention that when I click around in the Cisco folder on my Windows machine, there is a "security catalog" with all kinds of wonkiness in it that I don't know much about. Maybe these certificates/thumbprints are at play.
So, I admit total noobness here, and would appreciate any help. If I said something senseless, or if there is other information that might apply, I'll do my best to clarify.
Are you logging in with SQL Server authentication? And how are you running your queries? Sproc have implied rights, meaning if your using a table that you don't have access to it will still work but doing a simple select will deny access, Long shot but who knows.
Here is a link where Pinal Dave talks about a similar error and goes through in detail how to check to make sure the instance is up and a number of other troubleshooting steps you should try. http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/

Timeout only when connecting through Management console

I'm using SQL server 2008r2 on a windows 2003 server and connecting to it from a vista machine.
The database itself is part of an application that uses ODBC to connect and that connects perfectly 100% of the time.
But as I'm making some changes to the application and database I'm working through the management console. The first time I try and connect to the db in the morning it times out.
I have a work around for it that involves remote desktoping to the server and connecting to the db using the mamangement console on the same server. Once I have connected locally I can close the remote session and then I'll be able to connect to the server from the management console on my pc. This connection will stay open all day but if I close the management console for a while (10+ mins, I havent fully tested how long) it will timeout again.
This happens from other client pcs as well so I'm thinking that I need to change something on the server... does anyone have any pointers as to what settings could cause this login timeout? and what I can do to fix it as its becoming a serious annoyance!
It sounds like you need to enable TCP/IP protocol. You can do this via SSCM (SQL Server Configuration Manager).
I think I have got it figured out now. The solution that seems to work is linked to TCP/IP protocol, as the above poster mentions. I needed to go into the protocol and update the ports used from dynamic to fixed and put them on 1433 (why this isn't default I dont know, and I presume theres good reason for it!)
Answer found on the post below
https://serverfault.com/questions/179898/sql-server-timeout-on-first-attempt

SQL Server Remote Debugging Across Different Domains

I'm running VS2008 on my client machine and I'm running SQL 2000 on the remote db server which is on a different domain. I am able to remote desktop to the remote computer and use query analyser to debug, however it doesn't work when I try it remotely. I don't get any errors and when I try and step into the sp it doesn't halt.
From the research I have done it looks like the client PC is trying to attach to a process on the remote machine. However since this is on an another domain the user that VS 2008 uses won't be able to authenticate with the remote machine.
I believe this possible but my question is what do I need to configure to make this work, or is there any additional software that I require for this. I've tried using the VS Remote debugging monitor on the db server, but not sure whether I'm barking up the wrong tree with this.
Thanks
The knowledgebase article INF: Transact-SQL Debugger Limitations and Troubleshooting Tips for SQL Server 2000 may still be relevant/helpful (although obviously, they've fixed the first mentioned limitation concerning terminal services/remote desktop)

SQL Server Browser showing only hostname, not instance name

I just setup a new Windows Server 2008 machine with an instance of SQL Server 2008 Express. The SQL Browser service does not appear to be working correctly. In Management Studio, browsing for servers shows the hostname of the new server, but not the instance name. When you choose the hostname form the list it doesn't connect. But I can connect manually by typing the hostname\instancename combination.
update 1:
The browser service is running, and I have tried it with several different accounts, including domain administrator which is a bad practice, but I tried anyway for troubleshooting purposes.
I have tried punching the appropriate holes in the firewall, and also completely turning the firewall off.
This is running on a Hyper-V, Windows Server 2008 32 bit guest, which is on a Windows Server 2008 64-bit host. I have done this before (without issues) on this same host, but with SQL 2008 Standard instead of Express.
When I browse for the server in SSMS(Express) on the SQL Server machine, it works fine and shows the whole instance name. When I browse for it on a remote machine (on the same intranet) with SSMS (standard) it just shows the host name.
update 2:
Followed the packets as suggested and found the following
The client sent the broadcast as expected and received correct responses from other SQL Servers on the same network.
The server received the broadcast but did not send a response.
Considering these results, I wonder why the host name ever appears in the client list in the first place. It shouldn't show up at all, right?
update 3:
Spent an hour and a half on the phone with Microsoft support. I learned a few things, but the problem is not yet solved. It was suggested that I try installing an instance of SQL Standard on the same machine. I did that and the new instance exhibits all the same symptoms. The hostname shows up in the browse list only once, not once for each instance.
update 4:
Stackoverflow chose an answer for me thanks to the bounty system, but this question is not answered. Today I tried moving the whole VM to a different host server - everything is exactly the same. The hostname still appears in the browse list, without the instance name.
update 5:
Confirmed that Hyper-V Integration Services are installed on the guest (SQL) server.
check that the browser service is running, it's not turned on by default.
UPDATE1: See if you can install Network Monitor/Wireshark to do a network trace on the SQL Server to see if it's receiving the broadcasts and sending responses. I think this is your best option in troubleshooting this issue. According to MSDN the service uses UDP port 1434, so this is the traffic to watch.
UPDATE2: Does the server have multiple IP's? according to this MSDN article the Windows Server 2008 firewall has issues responding to SQL Browser service broadcasts, even with rules allowing packets through.
I tend not to rely on browsing. You'll get inconsistent results because browsing sends out a broadcast udp/1434 packet and waits for responses back. However, since you are able to connect remotely via SERVERNAME\INSTANCENAME, that aspect of the SQL Browser service is working. If it wasn't, you wouldn't have been able to connect. With that said, to troubleshoot the browsing portion:
Have you tried stopping and restarting the SQL Browser Service?
Have you tried stopping and restarting the instance if that didn't work?
To completely troubleshoot this, unfortunately, you'd have to do packet traces.
Sounds like the browsing service is messed up somehow...
I don't know if you can temporarily take this SQL Server down temporarily. But if so, you may want to try this:
Uninstall all SQL\instances completely.
Run the install of SQL Express 2008
Create a default instance during install (Not a named instance)
Run the installer again and create the default named instance (SQLExpress)
Try connecting to the named instance again. If it works, you can remove the default instance.
I had the same issue in a VM. After shutting down the Firewall it worked.
I just had this same issue. I was not able to see Instance Names in the SSMS Network Servers tab. It turned out that I had set up Hyper-V and created an Internal Network on my local machine. That network was identified as a Public/Guest Network and the Windows Firewall was ENABLED for it, even though my Domain setting has the Firewall DISABLED. Once I disabled that guest network on my computer I could see all the instances.
Machines:
Physical SQL Server 2014 Ent
Windows 8.1 laptop running Hyper-V

Resources