pgcli
pgcli copied to clipboard
SSH tunneling with a SSH key
I've installed these packages:
$ pip install --upgrade pgcli
$ pip install sshtunnel
I'm trying to run:
$ pgcli postgresql://someone:secret1@localhost:4567/mydb --ssh-tunnel anyone:[email protected]:789
I get this output:
Could not establish session to SSH gateway
Indeed I use a custom SSH key: ~/.ssh/chesu_rsa
so I tried with:
$ pgcli postgresql://someone:secret1@localhost:4567/mydb --ssh-tunnel anyone:[email protected]:789 -i ~/.ssh/cype_rsa
or
$ pgcli postgresql://someone:secret1@localhost:4567/mydb --ssh-tunnel anyone:[email protected]:789 -K ~/.ssh/cype_rsa
I get these error messages respectively:
Error: No such option: -i
Error: No such option: -K
How do I resolve this problem?
PS: I'm using latest version of pgcli and sshtunnel.
Make sure you don't use ProxyJump in ~/.ssh/config for the tunnel host. I have the same error and replacing ProxyJump with ProxyCommand ssh -W %h:%p fixed it.