I am running an app on a Linux box where I am already logged in. I want to spawn a process that needs to run as root. I have tried to use UnixLoginModule to login as root :
but my callback handler that would supply the password is never called and I don't appear to be logged in as root. It looks like UnixLoginModule simply returns data about the current user which is a fat lot of good. Does anyone know what I can do to make this thing do what it is supposed to do and allow me to perform a login? If JAAS is inadequate is there another way to acheive this?
Regards,
Matthew<br /> <br />Surrey, England<br /> <br />SCJP, SCBCD<br />Preparing: SCWCD, SCEA<br />My env: JBoss-4.0.0RC2 running on j2sdk1.4.2_06 running on Linux 2.6.11-1.14_FC3 running on Intel Pentium 4E Prescott 3.0GHz FSB800 1MB Cache on a ASUS P4S800 SiS648FX Socket 478 800FSB 3DDR 400 ATA133 motherboard
if your application only ever needs to run on this one machine, or a very few machines, then the canonical solution is sudo. if you need to do it in pure java, though, i'm afraid i can't help.