Home > Documentation, English > Using SSH for tunneling, kicking users, etc

Using SSH for tunneling, kicking users, etc

A very useful resource (in French) to use SSH, with specific use cases: http://pix-mania.dyndns.org/mediawiki/index.php/OpenSSH#Les_tunnels_SSH

Another useful (and short one for tunneling): http://www.howtoforge.com/reverse-ssh-tunneling

In short, if you have a configuration with 3 computers (A – B – C) and you want to connect to A from C but A doesn’t allow direct SSH connection, you can do the following:

  1. On A and B, install openssh-server
  2. On A, open an SSH connection to B: ssh -R 5000:localhost:22 user-on-B@B
  3. From C, connect to B: ssh user-on-B@B
  4. Using the open connection on B, open a connection to A: ssh -p 5000 user_on_A@localhost

This should get you all ready to work on A.

Another special case is you have A-B-C, you are on C and want to access the internal website running on A, but you can only access B in SSH, and from B, access A.

  1. Install openssh-server on A and B
  2. From C, instruct your SSH client to connect to B and to link your local port 8080 to A’s port 80: ssh -L 8080:A.A.A.A:80 user_on_B@B.B.B.B
  3. Open your browser on http://localhost:8080
Categories: Documentation, English Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: