Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
We have a server implemented in C where we would like to improve authentication when a client requests service (via an SSL connection).
The client can run from anywhere but will be updated to send a LoginID/password (over the encrypted link), but how can we verify this?
Actual Linux authentication is setup in LDAP. Attempts to use 'getpwnam(...)' and other similar functions have all failed -- since we do not (and don't want to) run the server as 'root', these return 'x' instead of the encrypted password. In fact, we'd rather not even retrieve the encrypted password in the first place.
Is there any function such as:
canLogin(final char *login, final char *pwd)
which would run at a non-root level but still authenticate the given login/pwd and return either 0 or an error code (or possibly the UID of the user if it verifies OK)?
Essentially, 'canLogin' verifies that if this login/pwd were presented at a normal Login: prompt, then the login would be accepted.
We understand the potential hacking problem, so would expect some built-in time delay to prevent a rapid series of calls.
The only other solution appears to be forking another process and use SU to 'root' to gather the data, but this appears both messy and a potential security breach.
As you've not mentioned it so far, I'd have to just suggest that you need to look at libpam to do all of this for you, that's exactly what it's there for.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.