LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-08-2009, 01:02 PM   #1
jcrowley
LQ Newbie
 
Registered: Mar 2006
Posts: 17

Rep: Reputation: 0
Authenticate loginID/Password if not 'root'


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.

Thanks for any suggestions.
 
Old 11-08-2009, 02:21 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 11-09-2009, 06:54 AM   #3
jcrowley
LQ Newbie
 
Registered: Mar 2006
Posts: 17

Original Poster
Rep: Reputation: 0
libpam

Was completely unaware of this but it looks like it should do what we need. Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't authenticate with root password rcmonroig Linux - Security 3 08-04-2009 08:21 PM
Unable to authenticate user with Fedora 10 and I know the password is correct eomalley Fedora 3 04-08-2009 01:59 PM
How could normal user obtain root password or change root password ckamheng Debian 18 02-18-2009 10:28 PM
How can i make Squid to authenticate username and password ? winxandlinx Linux - Networking 4 08-08-2006 10:42 PM
kppp issue - doesnt authenticate 'root' password ayrusnes Linux - Software 3 09-06-2004 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration