azuredatastudio icon indicating copy to clipboard operation
azuredatastudio copied to clipboard

Feature request: built-in SSH tunneling

Open chucker opened this issue 8 years ago • 36 comments

  • SQL Operations Studio Version: 0.24.1

Steps to Reproduce:

  1. Create a new server connection
  2. As Server name, specify one that isn't directly reachable from your client

I've seen this offered in various other RDBMS clients such as PSequel and related admin tools such as Royal TSX, but notably not in SQL Server Management Studio.

GUI-wise, PSequel solves this with a [ ] Use SSH Tunneling checkbox that reveals the additional field SSH Host, Port, and User, as well as Identity File. Typically (but not necessarily), in this configuration, the Server name field would then be filled with localhost or similar.

Internally, you first set up an ssh connection with a client-to-server port forwarding (typically, of port 1433), then run the database connection against that forwarded port. For example:

ssh -NL 1433:localhost:1433 myUser@theRemoteServer

Here, theRemoteServer runs both SQL Server (on port 1433, but not publicly accessible) and an SSH server (on the default port 22, and accessible).

This feature's purpose is to:

  • alleviate the need to manually run the above ssh command manually each time
  • attach the SSH configuration to the SQL configuration

chucker avatar Dec 26 '17 13:12 chucker

Any progress with this?

bomb-on avatar Mar 28 '19 13:03 bomb-on

I was really hoping with the addition of PostgreSQL that this would bubble up to the top of the list.

jwhaley58 avatar Apr 01 '19 17:04 jwhaley58

Handy for PostgreSQL users, it would be nice to see an update on this.

dgadelha avatar Jan 15 '20 01:01 dgadelha

Should this not be directed to the Postgresql Add-on. Or could this be built as it's own add on?

ScriptingDad avatar Apr 02 '20 15:04 ScriptingDad

it would be great to see this for all connection types and it's a common feature in other sql gui's

far-blue avatar Jun 04 '20 13:06 far-blue

This is the only thing stopping me from using data studio.

riyadparvez avatar Jul 30 '20 12:07 riyadparvez

Would something like the the VS Code Remote SSH extension (i.e. https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh#:~:text=Visual%20Studio%20Code%20Remote%20-%20SSH%20The%20Remote,and%20troubleshooting%20in%20a%20wide%20variety%20of%20situations.) be a good solution for this problem? It provides ssh tunneling and connections would be initiated from the remote machine. Or is this request really only for the ssh tunneling functionality?

kburtram avatar Jul 30 '20 15:07 kburtram

The VSCode remote capabilities work by starting a 'server' instance on the remote and I don't think that's really needed or generally useful in this case. All I really need is for DataStudio to automate something like:

  1. Create an ssh tunnel using ssh -L<local unused port>:<db host>:1433 <remote host>
  2. Create a db connection using localhost:<local port from above>

The ssh connection can be configured to not open a terminal, for better security. Preferably libssh or the openssh cli client should be used so I can configure all my connection parameters in ~/.ssh/config like normal and use ssh-agent for authentication just like a normal ssh connection.

far-blue avatar Jul 30 '20 15:07 far-blue

Man support for this natively would be nice. Took me quite a few tries to figure out how to get it to work with a custom local port.

(I'm doing this because i have several simultaneous connections to many postgresql servers and you cant use the same port more than once -- duh.)

If this is helpful to anyone else:
open a CLI and open a SSH with port forwarding in the typical way like this:

ssh -L 6543:localhost:5432 uname@remotehost  

But when you create your connection, click advanced and enter the custom port but ONLY the custom port (the local port -- 6543 in this example).

I was typing localhost in the hostname on the basic page (correct) AND 127.0.0.1 in the ipaddress on the advanced page (not correct!) and it was failing. as soon as I blanked out the ip but left the port -- poof it works.

Very much looking forward to leaving dbeaver behind -- as i'm a long time SSMS guy i find it ... uncomfortable.

jroosameresco avatar Sep 17 '20 20:09 jroosameresco

Thank you for opening this suggestion! This enhancement is not planned in our medium-term roadmap. The issue is being closed to reduce active issues to focus on enhancements that are being considered for an upcoming release. We will review closed issues with the 'Out of Scope' label when doing long-term planning.

github-actions[bot] avatar Sep 10 '21 18:09 github-actions[bot]

Now that private endpoints are generally available in Azure especially this becomes more than a nice to have. Not just for Postgres - it is only an example here because this works so well in PGAdmin4 (the rest of which might be flaky but improving). Datagrip has it. Yes you can do it manually, and you don't need additional loopback ip's (useful for some, though).

mckenzm avatar Aug 18 '22 07:08 mckenzm

Any update in these past few months?

reukiodo avatar May 12 '23 19:05 reukiodo

The lack of tunneling is single-handedly stopping me from using this product.

jesse-dot-id avatar Jun 27 '23 00:06 jesse-dot-id

This should be a high priority. Anyone running a cloud server who isn't comfortable simply exposing the database to the web needs this feature to use ADS at all. I'd like to use ADS for my latest project, but I simply cannot because of the lack of this long-since-requested fundamental feature. Please reconsider your decision not to implement it.

yorkshirelandscape avatar Jul 09 '23 10:07 yorkshirelandscape

Should definitely be implemented, seems like pretty basic functionality.

ninbura avatar Sep 06 '23 01:09 ninbura

+1 this is absolutely a needed feature

cvietor avatar Nov 21 '23 09:11 cvietor

it is NEEDED feature

Nova-Logic avatar Nov 25 '23 21:11 Nova-Logic

This is still out of scope? It's coming up on its 5yr anniversary! It's old enough to go to school now! "chucker opened this issue Dec 26, 2017"

reukiodo avatar Dec 01 '23 22:12 reukiodo

Wanted to +1 on this issue, given that this request is one of the oldest and most active feature requests in the backlog right now I'm really hoping MS considers this when planning for the release after February.

NovaLogicDev avatar Jan 12 '24 17:01 NovaLogicDev

Up +1

ghost avatar Feb 06 '24 08:02 ghost

https://xkcd.com/2881/ - so at what point are we going to start a party convention for ADS ssh?

reukiodo avatar Feb 08 '24 03:02 reukiodo

@reukiodo yep, this is so old, that I even meet @NovaLogicDev that is using practically same nickname:-) I believe we're ready to make a party, or , maybe to prepare a rally for the ADS ssh support

Nova-Logic avatar Feb 08 '24 10:02 Nova-Logic

Interesting, would be 10 years enough for MS to implement ssh tunnelling?:))))))

Nova-Logic avatar Feb 08 '24 23:02 Nova-Logic

Up

weitungliao-33 avatar Feb 14 '24 01:02 weitungliao-33

+1

alokkhg avatar Mar 11 '24 18:03 alokkhg

It would be nice if we could get @kburtram and @cheenamalhotra to comment on the current status of this request. Perhaps there is someone else we should be escalating this request to if either of you is not responsible for planning this project.

NovaLogicDev avatar Mar 11 '24 19:03 NovaLogicDev

perhaps @Charles-Gagnon @kisantia or @smartguest as they are leading active contributors to this repo.

NovaLogicDev avatar Mar 11 '24 19:03 NovaLogicDev

+1

biju-ps avatar Mar 31 '24 11:03 biju-ps

+1

BoudewijnPopkema avatar Apr 18 '24 18:04 BoudewijnPopkema

We need this

Carloswaldo avatar May 28 '24 16:05 Carloswaldo