[ale] starting binaries as insignificant users

Christopher Fowler cfowler at outpostsentinel.com
Mon Mar 10 09:04:50 EST 2003


SU in that manner uses "sh -c" to execution a login shell.


Here is what you do.

setgid(<group id here>);
setuid(<user id here>);

execl(arg[0], arg[1], ... arg[N[);


You are done.  You do not need a shell to execute a program, su was just
written that way.


On Sun, 2003-03-09 at 21:28, Jonathan Glass (IBB) wrote:
> On Sun, 2003-03-09 at 19:30, John Wells wrote:
> > I have a server program I'd like to start as a userid that doesn't have a
> > login shell.  I've created the user, modified /etc/passwd to point to
> > /dev/null (I've tried /sbin/nologin as well), and the tried an "su user -c
> > process".
> > 
> > Apparently, su requires a valid shell.  What's the generally accepted way
> > of doing this?
> > 
> > Thanks!
> > John
> 
> Look in /etc/xinetd.d/ at the config files.  You should be able to
> duplicate one of these, modify it to fit your application and username,
> register it with chkconfig (man chkconfig), and have it start at boot.
> 
> HTH
> 
> Jonathan Glass
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale


_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list