ssh-tunnel

PyCharm: Configuring multi-hop remote Interpreters via SSH

筅森魡賤 提交于 2019-11-30 03:14:49
To connect to the computer at my office I need to run ssh twice. First to connect to the host-1 and then from host-1 to host-2 and each one has different credentials. However the configuration menu in Pycharm only accepts one ssh tunnel. Configure Remote Python Interpreter dialog box Is there any way to set a multi-hop ssh to have access to the interpreter and data files on the host from local? AHA You can use port forwarding on ssh. If local system is A , the next ssh hop is B , and the target hop is C , open a terminal and run: ssh -L 6000:<server C IP>:22 <user_serverB>@<server B IP> You

How to bypass firewall and NAT with reverse SSH Tunnel

天大地大妈咪最大 提交于 2019-11-29 21:57:37
I'm trying to generate an SSH server in a machine behind a router. First I tried to bind the SSH to my public IP address: ssh -R 10002:localhost:22 <ip_address> Then I'm prompted with a password request, however my username password doesn't seem to work. Obviously I know my username password, so it seems to me that it's trying to authenticate in another computer under the same network. Any suggestions how to fix this? It would also help me any alternative on how to create an SSH server behind a Router when you don't have access to the Router. The ports in iptables are all open. UPDATE As

ssh: check if a tunnel is alive

我的梦境 提交于 2019-11-29 19:52:20
I have written a small bash script which needs an ssh tunnel to draw data from a remote server, so it prompts the user: echo "Please open an ssh tunnel using 'ssh -L 6000:localhost:5432 example.com'" I would like to check whether the user had opened this tunnel, and exit with an error message if no tunnel exist. Is there any way to query the ssh tunnel, i.e. check if the local port 6000 is really tunneled to that server? Tommy This is my test. Hope it is useful. # $COMMAND is the command used to create the reverse ssh tunnel COMMAND="ssh -p $SSH_PORT -q -N -R $REMOTE_HOST:$REMOTE_HTTP_PORT

How to connect MySQL database using Python+SQLAlchemy remotely?

送分小仙女□ 提交于 2019-11-29 13:17:56
问题 I am having difficulty accessing MySQL remotely. I use SSH tunnel and want to connect the database MySQL using Python+SQLALchemy. When i use MySQL-client in my console and specify " ptotocol=TCP ", then everything is fine! I use command: mysql -h localhost —protocol=TCP -u USER -p I get access to remote database through SSH-tunnel. However, when I want to connect to the database using the Python+SQLAchemy I can't find such option like —protocol=TCP Otherwise, i have only connect to local

JSch multiple tunnels/jumphosts

廉价感情. 提交于 2019-11-29 12:46:29
I'm not sure if this is caused by using a private key instead of password for the port forwarding but here's what I'm trying to do I need to forward local port 3308 all the way to the my SQL DB at 3306. I can run things like this all together in terminal on my local ssh -L 3308:localhost:3307 username@jumpbox "ssh -L 3307:mysqlDB:3306 username@server" Or run the first part on my local and then the second part on the jumpbox. Both works fine and I can connect to my localhost:3308. The problem comes when I start using JSch. Here is my code JSch jsch = new JSch(); jsch.addIdentity("~/.ssh/id_rsa"

How to bypass firewall and NAT with reverse SSH Tunnel

眉间皱痕 提交于 2019-11-28 17:57:51
问题 I'm trying to generate an SSH server in a machine behind a router. First I tried to bind the SSH to my public IP address: ssh -R 10002:localhost:22 <ip_address> Then I'm prompted with a password request, however my username password doesn't seem to work. Obviously I know my username password, so it seems to me that it's trying to authenticate in another computer under the same network. Any suggestions how to fix this? It would also help me any alternative on how to create an SSH server behind

How can I connect to Oracle Database 11g server through ssh tunnel chain (double tunnel, server in company network)?

对着背影说爱祢 提交于 2019-11-28 16:43:46
I have SSH access to 'public' server, which is also the gateway to company network. There is another server in the network, where local Oracle Database server is running (There is no access from outside of this server, only localhost DB connections are accepted). And of course, I have another SSH access to this server. Is there any way to join to this Oracle Database 11g Server from outside of the network ? I am asking if there is something like ssh tunnel chain, and how i configure it. This can be usefull, for example, for TOAD for Oracle (ORACLE client). EDIT: Here is image Thanks Yes, it's

Advance ssh config file

青春壹個敷衍的年華 提交于 2019-11-28 10:38:42
How to ssh directly to Remote Server, below is the details description. Local machine ---> Jump1 ----> Jump2 ----> Remote Server From local machine there is no direct access to Remote Server and Jump2 is disable Remote Server can only be accessed from Jump2 There is no sshkegen to remote server we have to give the paswword manually. from Local Machine we access the Jump1 with ip and port 2222 then from Jump 1 we access the Jump2 with host name default port 22. With ssh/config file we were able to access the jump2 server without any problem. But my requirement is to directly access the remote

Can't connect to local MySQL server through socket error when using SSH tunel

故事扮演 提交于 2019-11-27 16:13:20
问题 I am trying to use dplyr to connect to a remote database, that I usually query through a ssh tunnel. I first set up a ssh tunnel like the following: alias tunnel_ncg='ssh -fNg -L 3307:127.0.0.1:3306 mysqluser@myhost mysql5 -h 127.0.0.1:3306 -P 3307 -u mysqluser -p mypassword' At this point I can access the database by connecting to localhost:3307. For example: mysql -h '127.0.0.1' -P 3307 -u mysqluser If I try to access the same database through dplyr, I get an error complaining that it can't

MySQL connection over SSH tunnel

坚强是说给别人听的谎言 提交于 2019-11-27 12:24:15
I have set up a SSH tunnel between two servers A and B . B has MySQL server, and this works: mysql -h localhost -P 3306 -u user -p While this doesn't: mysql -h 127.0.0.1 -P 3306 -u user -p Although my.cnf has these lines: bind-address = 127.0.0.1 # Next addr differs slightly, but anyway bind-address = 99.99.99.99 Now about the tunnel. It connects the following: (A) localhost(9989) -> (B) localhost(3306) But when (on A , with ports forwarded) I do mysql -v -h 127.0.0.1 -P 9989 -u user userdb -p I get ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet',