ssh-tunnel

SSH tunnel: local => gateway => MySQL server

前提是你 提交于 2019-12-20 10:30:03
问题 I need to access a MySQL database on a remote server at my lab. The server is only accessible once I log in to a gateway server on the remote network: local server => gateway server => MySQL server. I can ssh to the gateway using port 24222. I am using the PERL DBI module. This is what I use to connect when I am at the lab: my $host="1.2.3.4"; my $database="dbname"; my $user="user"; my $pw="pass"; my $table="table"; I imagine I have to set up a tunnel through the gateway server to the

SSH port forwarding in Docker

百般思念 提交于 2019-12-20 04:08:29
问题 I have these two containers, say backend (CentOs) and mongo . What I would like to have is that from within the backend container I can connect to the mongo database as if it was running locally, $> mongo localhost:27017 Anyway, as far as I understand all this, you can map the port localhost:27017 to mongo:27017 like this $backend> ssh -L 27017:mongo:27017 root@mongo However, if I do this I have to provide the root password and after that it logs me into the mongo container and no port

Connecting to remote PostgreSQL database over SSH tunnel using Python

家住魔仙堡 提交于 2019-12-19 04:04:29
问题 I have a problem with connecting to a remote database using SSH tunnel (now I'm trying with Paramiko). Here is my code: #!/usr/bin/env python3 import psycopg2 import paramiko import time #ssh = paramiko.SSHClient() #ssh.load_system_host_keys() #ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) #ssh.connect('pluton.kt.agh.edu.pl', 22, username='aburban', password='pass') t = paramiko.Transport(('pluton.kt.agh.edu.pl', 22)) t.connect(username="aburban", password='pass') c = paramiko

PyCharm: Configuring multi-hop remote Interpreters via SSH

故事扮演 提交于 2019-12-18 10:52:50
问题 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? 回答1: You can use port forwarding on ssh. 1. Open a terminal and run: On your local system: ssh -L

JSch multiple tunnels/jumphosts

*爱你&永不变心* 提交于 2019-12-18 07:04:56
问题 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

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

元气小坏坏 提交于 2019-12-17 22:08:14
问题 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

How to open an SSH tunnel using python?

一曲冷凌霜 提交于 2019-12-17 20:01:25
问题 I am trying to connect to a remote mysql database using django. The documentation specifies that it is required to open an SSH tunnel first to connect to the database. Is there a python library that can open an SSH tunnel whenever certain settings are set? 回答1: You could try paramiko's forward functionality. For a paramiko overview, see here. 回答2: Here is a code snippet for Python3 (but you should be able to retrofit it into Python2 without difficulty). It runs an SSH tunnel in a separate

How to set Google Apps Engine appcfg to use SSH tunnel?

梦想与她 提交于 2019-12-13 08:58:51
问题 I set a ssh tunnel using putty and configured windows setting and Firefox proxy to browse the internet through it. It works perfectly. Now I want to upload my GAE app via the same ssh tunnel. What do I have to do to do it ? 回答1: In Windows you could get a software that would socksify the app you need to use the tunnel (socks proxy), google some of these for more details: SocksCap FreeCap WideCap etc... 来源: https://stackoverflow.com/questions/31646879/how-to-set-google-apps-engine-appcfg-to

How to use exec() in php in combination with ssh 'hostname' command?

本秂侑毒 提交于 2019-12-13 03:44:40
问题 I have a simple script I'm trying to run: <?php print exec('whoami'); $output2 = exec('ssh someotherhost ls -l /path/to/dir',$output); print_r($output); print_r($output2); print $output2; ?> The goal of this script is to run a command on another networked server. If I run the above ssh command (replacing the dummy data with real data) from the command line: ssh someotherhost ls -l /path/to/dir It outputs the proper ls lines. However, when I run the above script from the same dir with the same

Using dispy with port forwarding via ssh tunnel

点点圈 提交于 2019-12-13 02:39:39
问题 I have dispynode running on a remote server. I'm trying to open an SSH tunnel from my computer (client) and configure dispyJobCluster to use this tunnel. But it's not working. Am I not configuring this right ? Here's how I'm doing this : ( p.s . i don't have a deep knowledge in distributed & parallel computing nor networking, I'm a civil engineer so please excuse me if I don't use the right technical words sometimes ) SSH tunnel​ : plink -v -ssh -L 61:localhost:21 user@myserver.net This will