ssh-tunnel

Unable to reach SQL database through SSH tunnel using sqlcmd

帅比萌擦擦* 提交于 2020-04-10 14:09:47
问题 I need to connect to a an Azure SQL DB from my local machine through a jump box (Azure VM). I set up the port forwarding using the command: ssh -fN -L 41433:my-db.database.windows.net:1433 me@jump-box I can confirm the tunnel is set up because in verbose mode i see the message Local connections to LOCALHOST:41433 forwarded to remote address my-db.database.windows.net:1433 Now, when I run sqlcmd -S 127.0.0.1,41433 -U username -P password -d db I get the following error message Sqlcmd: Error:

Access Android Market through SSH tunnel

倾然丶 夕夏残阳落幕 提交于 2020-02-25 00:41:21
问题 My mobile provider firewalls me from downloading applications from the Android market. So what I am trying to is to tunnel all traffic to the Android Market through an SSH connection. A quick search told me that apps are downloaded using port 5228. Thus, I followed those steps: Create an SSH tunnel on dynamic port 5228 using the ConnectBot application On the server side: tcpdump port 5228 Download from Android markert Step 2 does not produce any output, and the app download fails. Therefore,

Run remote commands through SSH tunnel in Java

不羁岁月 提交于 2020-02-21 06:12:27
问题 I need to run some commands from a remote computer using an SSH connection, but the problem is the following: The client computer (running Windows) is connected to a network where I can see a server remote (second *nix computer, in the same network). I can do SSH connections with it, however the computer that contains the files (running *nix) isn't in this network, I only can connect with this trough a dynamic SSH tunnel open in the second computer, where I normally use PuTTY to configure

Run remote commands through SSH tunnel in Java

核能气质少年 提交于 2020-02-21 06:12:05
问题 I need to run some commands from a remote computer using an SSH connection, but the problem is the following: The client computer (running Windows) is connected to a network where I can see a server remote (second *nix computer, in the same network). I can do SSH connections with it, however the computer that contains the files (running *nix) isn't in this network, I only can connect with this trough a dynamic SSH tunnel open in the second computer, where I normally use PuTTY to configure

using Net::SSH::Gateway to setup a tunnel (hung at .new)

一笑奈何 提交于 2020-01-17 07:51:32
问题 Just as in Using net/ssh/gateway to establish ssh tunnel to mysql, I'm trying to use Net::SSH::Gateway set up a tunnel to a remote server for port forwarding. But I'm getting stuck earlier in the process! :) TL;DR How do I condition OpenSSL and Net::SSH::Gateway.new() for tunneling to a remote server? what works... I can set up a tunnel by starting an ssh process in the background as follows: remote_addr = <some_remote_server.com> remote_user = <some_remote_server@somehost.com> ssh -f -N -L

SSH tunneling to a remote DB from Heroku?

风流意气都作罢 提交于 2020-01-14 14:25:07
问题 I'm thinking of deploying a small Rails app on Heroku. In an effort to save money, I'd like my app to use an external database (to which I have free access), rather than a Heroku-hosted database. The trouble is that the free database only accepts local connections. To access it from Heroku, I'd need to do so via an SSH tunnel. Is it possible for a Heroku app to persist its data in an external DB accessed via SSH? If so, how? (For bonus points, here's a second question: is this a good idea? On

Connect to google collab with ssh from console from PC

不打扰是莪最后的温柔 提交于 2020-01-12 10:42:27
问题 I've found one instruction on the net how to do it: #Generate root password import random, string password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20)) #Download ngrok ! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip ! unzip -qq -n ngrok-stable-linux-amd64.zip #Setup sshd ! apt-get install -qq -o=Dpkg::Use-Pty=0 openssh-server pwgen > /dev/null #Set root password ! echo root:$password | chpasswd ! mkdir -p /var/run/sshd !

Connect to google collab with ssh from console from PC

徘徊边缘 提交于 2020-01-12 10:41:07
问题 I've found one instruction on the net how to do it: #Generate root password import random, string password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20)) #Download ngrok ! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip ! unzip -qq -n ngrok-stable-linux-amd64.zip #Setup sshd ! apt-get install -qq -o=Dpkg::Use-Pty=0 openssh-server pwgen > /dev/null #Set root password ! echo root:$password | chpasswd ! mkdir -p /var/run/sshd !

SSH tunneling a MySQL connection using C#

江枫思渺然 提交于 2020-01-11 06:48:08
问题 I was trying to use SSH tunneling to access my MySQL database using C# but I'm getting an exception Unable to connect to any of the specified MySQL hosts. I got this code with the help of this: C# SSH tunnel to MySQL server Here is my code: PasswordConnectionInfo connectionInfo = new PasswordConnectionInfo("example.com", 2222, "username", "password"); connectionInfo.Timeout = TimeSpan.FromSeconds(30); using (var client = new SshClient(connectionInfo)) { try { Console.WriteLine("Trying SSH

ssh: check if a tunnel is alive

强颜欢笑 提交于 2020-01-10 06:30:09
问题 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? 回答1: This is my test. Hope it is useful. # $COMMAND is the command used