Questions tagged [ssh-tunnel]

An SSH tunnel leverages the SSH protocol to transport unencrypted data through an encrypted connection.

An SSH (secure shell) tunnel provides a secure connection through which unencrypted data can be sent.

This technique can be useful for:
- Providing security for insecure network protocols.
- Hiding one's true location (ip).
- Circumventing blocked ports in firewalls.

818 questions
19
votes
4 answers

How to setup ssh tunnel to forward ssh?

I have computer with Ubuntu behind router that I can't configure. However I want to have ssh access to that computer. I think it is possible with ssh tunneling, but I don't know how to do it. I have another server to which I would like to setup…
klew
  • 713
  • 2
  • 11
  • 16
19
votes
2 answers

Remote Desktop over SSH SOCKS proxy to bypass firewall

I'm trying to connect to a Windows server from my Mac using RDC2.1 for Mac. The problem is the server I need to connect to is guarded by the evil dragon - IP-based access control on a completely separate network. I have an IP I can get in on, but…
simonhamp
  • 465
  • 1
  • 5
  • 13
16
votes
1 answer

ssh -R make target host accept connection on all interfaces

I have a SOURCE host which is remote and behind NAT. I want to connect to SOURCE via ssh from a TARGET host which is in my home network. Thus I issue the following command on SOURCE: ssh -R 2222:localhost:22 TARGET -N Now from TARGET I can connect…
Jack
  • 485
  • 1
  • 4
  • 12
16
votes
2 answers

How can I use port tunneling to connect to a private database instance through a network bastion?

I have a network bastion which is publicly accessible at example.compute-1.amazonaws.com and a private postgres database instance at postgres.example.us-east-1.rds.amazonaws.com:5432 I can ssh into the bastion using $ ssh -i key.pem…
Snubber
  • 313
  • 1
  • 2
  • 6
16
votes
4 answers

Copy data through SSH tunnel over multiple hops

We have two main environments in question: Development and QA Each environment has two servers: Jump Box Application server In order to connect to the application server, you must connect to the jump box first, and then SSH to the Application…
Barry Chapman
  • 400
  • 1
  • 4
  • 15
16
votes
2 answers

How to start a reverse tunnel with PuTTY?

I am trying to make a tunnel between a server and laptop with Putty. The problem is, since the laptop has no public IP address, I have to make a reverse connection. ASCII Artwork: SERVER(PORT:6000) ----------> LAPTOP(PORT:7000) However, since…
Ozer
  • 263
  • 1
  • 2
  • 4
16
votes
2 answers

Connecting to MySQL securely - MySQL's SSL vs Stunnel vs SSH Tunneling

We have a PHP application which connects to a MySQL server, and we wish to secure connections between the web & application servers and the database. At peak times, the web servers make many hundreds of concurrent connections to the database, and…
dastra
  • 195
  • 1
  • 5
15
votes
3 answers

MySQL access denied error when connecting via SSH tunnel

For months I've been connecting to the MySQL instance running on our local test server through an SSH tunnel without any issues. All of sudden though, with no changes I can think of, the server has started rejecting the log in attempt from Sequel…
Adam
  • 253
  • 1
  • 2
  • 7
15
votes
3 answers

autossh in background does not work

I have set up a tunnel via autossh. This works: autossh -M 33201 -N -i myIdFile -R 33101:localhost:22 autossh@myhost.com I would like to run autossh in background. Seems easy using the -f option. This does not work, however: autossh -f -M 33201 -N…
henning77
  • 315
  • 1
  • 2
  • 8
14
votes
5 answers

How can I get list of open SSH tunnels?

How can I get list of open SSH tunnels? I'm using Mac OS X client connected to FreeBSD server. I'm trying to query open tunnels on the client.
Eonil
  • 9,689
  • 15
  • 34
  • 53
14
votes
4 answers

SSH back to the local machine from a remote SSH session

I'm trying to do something rather unusual (for me anyway) with SSH and I can't get it to work, hopefully you can help. I want to establish a connection to a remote server from my Mac using SSH. So far so good. Now the tricky bit, with the connection…
i0n
  • 273
  • 1
  • 3
  • 8
13
votes
2 answers

How to make ssh fail if port forwarding fails

I have a bash script that runs ssh to create a port forward, using a command like this: ssh -N -i keyfile -L 1000:localhost:22 *remote_ip* There are occasions where the listen port may be busy, so this command gives the…
xorsyst
  • 241
  • 2
  • 7
12
votes
6 answers

SSH access gateway for many servers

Managing multiple servers, in excess of 90 currently with 3 devops via Ansible. All is working great, however there is a giant security problem right now. Each devop is using their own local ssh key to gain access directly to the servers. Each devop…
John
  • 877
  • 4
  • 15
  • 25
12
votes
2 answers

How does ssh ProxyCommand actually work?

I am comfortable with using the ProxyCommand feature of ssh and can use it to hop through mulitple bastion hosts to reach the final host efficiently. But I just can't seem to understand how it actually works in the backend. For eg. I have the…
Naruto Uzumaki
  • 309
  • 1
  • 3
  • 9
12
votes
6 answers

Reverse SSH tunnel: how can I send my port number to the server?

I have two machines, Client and Server. Client (who is behind a corporate firewall) opens a reverse SSH tunnel to Server, which has a publicly-accessible IP address, using this command: ssh -nNT -R0:localhost:2222 insecure@server.example.com In…
Tom
  • 3,133
  • 2
  • 19
  • 19
1
2
3
54 55