This works as follows:
I will connect to a remote host using ssh, specifying a port to be used to forward connections to the remote server. This will then make it possible to start the service which is to be encrypted on the client machine, connecting to the same local port, and ssh will encrypt and forward the connection.
Before we start, if you are wondering
#-- I am using backtrack 5 R3 Gnome 64
#-- I am using xChat IRC
#-- I purchased a VPS and used it as the remote host. (I am blocking out the IP of my VPS for security reason of course)
The following example will show you how to tunnel an IRC session from client machine “127.0.0.1” (localhost) to remote server “hackthissite.org”
- Code: Select all
:~# ssh -f -L 1234:localhost:6667 208.**.**.** sleep 10
- Code: Select all
:~# xchat --url=irc://irc.hackthissite.org:6667
This tunnels a connection to to your remote server, and allows allows the ports to connect to IRC server "hackthissite.org”. It doesn't matter which port is used, as long as it's greater than 1023 (also, keep in mind that you can only open ports on privileged sockets if you are running as root) and doesn't conflict with any ports already in use. The connection then gets forwarded to port 6667 on the remote server, since in most cases, that will be the port for IRC services.
In the example above, you would make sure to replace IP "208.**.**.**" with your remote host.
The -f option backgrounds ssh and the command “sleep 10” will allow 10 seconds to start the service which is to be tunnelled. If no connections are made within the time specified, ssh will exit.
If you need the irc client xChat IRC just run:
- Code: Select all
:~# sudo apt-get install xchat
I hope some of you can learn something from this.


