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:
- On A and B, install openssh-server
- On A, open an SSH connection to B: ssh -R 5000:localhost:22 user-on-B@B
- From C, connect to B: ssh user-on-B@B
- 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.
- Install openssh-server on A and B
- 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
- Open your browser on http://localhost:8080