0

I'm creating an internal tool that needs a bit of cpanel/webmin type functionality, but this isn't a situation where I could use one of those

Right now I need to be able to create linux users, groups, and directories via PHP. Here's what I have right now:

copies of useradd/groupadd/chpasswd in a user's /bin, SUID'd by root. the permissions are setup so only root and a specific group can access them (the group that the user is in).

If I run this from command line it works fine, but I was hoping to use suexec to access these, but it seems as if PHP won't work with suexec unless I run it through CGI which I don't really wanna do.

I could also allow wwwrun to access these SUID'd binaries but that seems a little insecure to me.

What is my next step here? Thanks!

1 Answer 1

2

This is a bad idea. Use PAM to move the authdb into something like a database where you don't need to invoke system tools in order to make changes.

2
  • could you give me any links to put me in the right direction on something like this?
    – Lowgain
    Nov 28, 2010 at 5:50
  • would PAM be used to allow users ftp/ssh access of specific directories, or would it be used to allow PHP to create users for that?
    – Lowgain
    Nov 28, 2010 at 21:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .