Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Assume I have an IRC server running on a linux box and the only way to get to that box is over ssh. I don't want to open any ports to the world, I just want folks with logins on that server to be able to connect to the IRC server running on that host.

I could always ssh to the server and forward some ports over SSH. Is there a better way? Are there IRC clients that will let me install my private key and then forward the IRC ports for me?

share|improve this question

migrated from Jan 17 '10 at 18:31

This question came from our site for professional and enthusiast programmers.

I imagine you should be able to write a script in many clients that will execute a command line to open a SSH connection with port forwarding, then connect to the appropriate port at localhost.

share|improve this answer
Beat me to it. For the OP, based on your criteria you have to use either an SSH tunnel or open a port on the public interface. The script is a nice way to bundle everything up. – Scott Anderson Jan 16 '10 at 16:16

If your users are all able to run irc clients on the same system as the ircd: Many clients and servers are able to use connections over UNIX domain sockets, so the only thing listening for incoming traffic is your sshd.

share|improve this answer

If you know how to set up SSH to authenticate using keys in the authorized_keys file you are already half-way there. You can configure the file to automatically run a script/command when the user with the private key logs in. This can even include running an IRC client on the server side.

Alternatively, on the client end, you will want to do a -L 6667:ircserver:6667 port forwarding. Then, just connect your IRC client to localhost:6667 and it should work fine.

share|improve this answer

If you have access to your firewall, you can possibly use something called portKnocking, which allows you to add a really sweet layer of security. Basically you "knock" on a specific range of ports a specific amount of times, and for a pre-determined set of time a specific port is opened for you to connect through. All of these variables can be set by you. I set it up on my router, which runs DD-WRT and its pretty nice.


share|improve this answer

I'd think that if you only wanted shell users on the ircd, the fastest, low tech way is run the ircd on local IPs only, for example then install a CLI based IRC client like weechat, irssi, bitchx or epic. Shell users then must ssh to the server, then start the irc client.

Installing and using screen can also help by allowing users to return to their shell without closing the irc client.

Hope that helps.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.