[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: running other than root.



On Wed, Oct 03, 2001 at 12:29:24PM -0500, Rawle Frank wrote:
> Can you also document starting ircd other than root. i have RHL 6.2 and running ircd. it works fine but i have to start is as root and it stays running as root. any other way i get permission denied or cannot chroot to /home/ircd. yes i tried changing ownership and gave chmod 777 on all. i did make a user called ircd.

The combination of chroot and running as non-root isn't something
that works very good, if you try to do both with ircd.  There is
an option for it to change uid, but for some reason it doesn't do
that when you use chroot.

What I suggest, and the way I do it myself, is that you set up an
external chroot.  We did plan to make some document about how to
set that up, but we never got around doing it.

There are basicly two ways of doing it.  You use /usr/bin/chroot,
and set up a full chroot environment, or you use some little util
that does a little more the choot and allows you to specify the
user it has to change to.

Note that it's very likely that you will have to make a copy of
some libs that ircd or iauth uses.  For some reason a staticly
compiled version didn't work for me.  Use "ldd ircd", and "ldd
iauth", to find out which libs you have to copy inside your
chroot environment.

I made some small program for myself that does chroot(), chdir(),
setgid() and setuid() with the values for me, but I know someone
made a version where you can specify that on the command line.

Note that it can be tricky to properly compile ircd to run in the
chroot as it should, the Makefile isn't really made for it.  What
I did was not to set the prefix when compiling, so "prefix =",
and set it to the dir it had to go in during install, so
"prefix = /home/ircd" for you.

If you need more help, ask.


Kurt