Configuring a FreeBSD IRC Shell Server

Posted on by admin

This is a brief guide created to help configure a secure FreeBSD as an IRC shell server.

In this case I will be running FreeBSD 6.0, with bash shell, SSHd, named (bind), httpd (Apache2+PHP4), FTPd (pure-ftpd).

Note: In many cases, if you don’t wish to review the config when adding to it you can do: echo ‘<string>’ >> <file> (ie: echo ‘accounting_enable=”YES”‘ >> /etc/rc.conf)

sshd

sysctl

This is my “/etc/sysctl.conf”:

security.bsd.see_other_uids=0
kern.securelevel=1
net.inet.tcp.blackhole=2
net.inet.udp.blackhole=1
kern.ipc.somaxconn=1024
net.inet.icmp.icmplim=50
net.inet.ip.rtexpire=2
net.inet.ip.rtminexpire=2
net.inet.tcp.always_keepalive=1
net.inet.ip.random_id=1

rc.conf

The latter half of my “/etc/rc.conf” looks like this:

inetd_enable=”NO”
linux_enable=”YES”
sshd_enable=”YES”

portmap_enable=”NO”
sendmail_enable=”NO”
nfs_server_enable=”NO”
nfs_client_enable=”NO”
accounting_enable=”YES”
clear_tmp_enable=”YES”
syslogd_flags=”-ss”
enable_quotas=”YES”
check_quotas=”YES”
ntpdate_enable=”YES”
update_motd=”NO”
named_enable=”YES”

Firewall

For a shell server, a firewall may not be required, but for many others it may be required.

Date and Time

You must ensure your system’s date/time is correct, otherwise SSH may fail and logs will be incorrect.

Login.conf

Using login.conf you can create custom classes for your users giving them all sorts of limits and restrictions.

pure-ftpd

Instructions are as follows:

Apache 2

oidentd

default {
default {
deny spoof
deny spoof_all
deny spoof_privport
deny random
deny random_numeric
deny numeric
deny hide
}
}

user root {
default {
force reply “UNKNOWN”
}
}

Note: You can add a user, if you want to allow spoof for certain users, and allow that.

Files and Permissions

ToDo

Additional Security

Resources

Final notes

I’ve written this as more of a reference, i’ve more than likely missed a few things, so feel free to add your own comments.

Related posts:

  1. Setting up a FreeBSD socks proxy server for use with mIRC Update: Looking for the sss.pl? Try the Simple Sockets Server...
  2. Installing Subversion on a cPanel Server It should be easy right? Just “yum install subversion”. Nope. You...
  3. The requested URL /cpanel was not found on this server If you run cPanel servers, then you may at some...
  4. error: no dbpath has been set I’ve recently been having trouble with a OpenVZ VPS upgraded...
  5. How to find the fastest CVSUP mirror server Some time ago I wrote about using fastest_cvsup, to find...

About admin

The author formerly known as HM2K is now the Phurix Labs administrator.

This entry was posted in Internet and tagged , . Bookmark the permalink.

10 Responses to Configuring a FreeBSD IRC Shell Server

  1. hm2k says:

    I think pretty much in freebsd 6.0+

    kern.ps_showallprocs=0
    kern.ps_argsopen=0

    Are no longer required, and a replaced by…

    security.bsd.see_other_uids=0

  2. rdns says:

    hi!

    this is the most useful guide for shell admin
    i’ll bookmark this
    thanks a lot!

  3. ruslie says:

    hi my psybnc ident has ~ string for example ~test@xx.xxx.xxx.xx
    how to fix it?
    thanks

  4. krasko says:

    realy nice

    thank you!

  5. deadpan says:

    great guide so far, any info on how to setup some sort of signup form that would allow a user to pick the user name and whatnot and have it added to the system?

  6. Taimur says:

    A perfect guide for a shell co. administrator.

    Thanks!

  7. prez says:

    Hey Ruslie,

    You’ll need to install oidentd or similar on the system in which your psyBNC runs on. (Identd Daemon!)

    (prez@DALnet / prez@EFnet / prez@Rizon)
    email: prez@dal.net

  8. Ruslie says:

    waw it has been 2 years since i asked that question :)

    and thank you prez :)

  9. prez says:

    No problem Ruslie. I figure, better late than never. ;) Haha.

  10. t1m1976 says:

    I actually can’t seem to get my FreeBSD 8.1 auth to work with IRC either. I’ve tried using the built-in auth, oidentd and pidentd. I’ve modifed the configuration files for both oidentd and pidentd and have tried using .oidentd.conf in a user’s home directory too. I have verified that the IRC servers are sending the request and that my host is answering those requests (/var/log/security and the verbose logging through ipfw). I have disabled the router firewall completely, but have not tried router DMZ mode. Still, I can not get any IRC servers to say anything other than * No Ident Response.

    Here’s the funny thing though:

    “auth” always returns user as root. I can not figure out why and have been wondering for a few days how to change that.

    “pidentd” always returns the user the daemon is running as (ie: the one configured in /usr/local/etc/identd.conf). If I omit the daemon server user, it will default to nobody. The latest version of pidentd also gives me a strange response, where it omits a space before the username so it smacks the username right up against the : before it. I’m not sure if that matters or not.

    “oidentd” didn’t seem to work for me either, but most people seem to be using this. I don’t really want to use that if I can get the built-in “auth” to return something other than root, though.

    Anyways, I know this comment section is not specifically for ident issues but I just thought I would mention it since I saw someone else comment about that too.

    Thanks for putting this page up; the suggestions are very useful.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>