in reply to Re: Authen::PAM Help
in thread Authen::PAM Help

Okay, fine... but I will still need my app to execute some binaries as the original user. Maybe PAM isn't the way to do it. Is there not a way I can run app A (as user or root, I don't care, but must be written in perl), and have app A execute various binaries both as the *original* user and some others with root privileges?

Replies are listed 'Best First'.
Re^3: Authen::PAM Help
by meredith (Friar) on Jul 17, 2004 at 01:48 UTC

    Umm, yeah....

    • user: system "/usr/bin/foo";
    • root: system "sudo /usr/bin/foo";

    You could run the app as root, and use sudo -u or fork, then drop privs, but that's just a bad idea.

    mhoward - at - hattmoward.org
Re^3: Authen::PAM Help
by jdalbec (Deacon) on Jul 17, 2004 at 01:45 UTC
    sudo -u <username> <command>

    Update: Sorry, I guess I misread "some others" as referring to other users instead of other programs. Anyway, you can use sudo to run programs as any user (if you have rights to do so) not just as root.