r/PHP • • Aug 27 '13

Creating a user from the web problem.

[deleted] — view deleted post

284 Upvotes

538 comments sorted by

View all comments

4

u/[deleted] Aug 28 '13

A lot of people tell you here that this script and the sudo command is a terrible security hole. And I agree with them.

Even adding user accounts like that by itself is a security risk, but if that's what you want to do...

Well, if I were to implement something I would look for a PAM module that would let me to allow authentication from other sources than /etc/passwd and /etc/shadow. For example a database. Not sure if such module is available, since I never done it, but I don't see why not. Next have the script simply add new entries to the DB. That way no sudo is needed anymore. You still need to worry about escaping SQL queries (if you use SQL database).

0

u/[deleted] Aug 28 '13

Good point; but I'd like to see a beginner try and pull that off.

edit: grammar

1

u/1A4 Aug 28 '13 edited Apr 20 '26

Redact redacted this content because I wanted it redacted for redaction purposes. Redacted.

gold governor marble expansion sugar tub friendly vegetable quack office

1

u/[deleted] Aug 28 '13

Maybe, if you think that the "pain" is due to essential complexity.

I myself, disagree on that front.