LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-11-2004, 04:42 AM   #1
linuxprogrammer
LQ Newbie
 
Registered: Jul 2004
Posts: 26

Rep: Reputation: 15
Question Matching encrypted user passwords


For a certain application, I want that the password the user enters should be matched against his actual user password as stored in the file '/etc/shadow'. How do I do that?

I was thinking, I could encrypt the password the user enters and then match it against the encrypted form stored in /etc/shadow. But how do i ensure that i am encrypting it in the correct way, so that that when the correct password is enterd, it does match the entry in /etc/shadow???
 
Old 10-11-2004, 08:40 AM   #2
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
Re: Matching encrypted user passwords

Quote:
Originally posted by linuxprogrammer


I was thinking, I could encrypt the password the user enters and then match it against the encrypted form stored in /etc/shadow. But how do i ensure that i am encrypting it in the correct way,
the shadow program uses MD5 encryption, read up on it
Quote:
so that that when the correct password is enterd, it does match the entry in /etc/shadow???
I suppose you can write a $script that compares what the user entered with the stored pass in /etc/shadow, the users line in /etc/shadow is a fixed string so, I guess fgrep() would be used to search fixed strings...........and use the
cmp() to compare the entered pass to what is stored...........


An easier way would be to put certain Applications in their own "group" for which certan users would only have access to this group........

Last edited by 320mb; 10-11-2004 at 08:48 AM.
 
Old 10-11-2004, 11:53 PM   #3
linuxprogrammer
LQ Newbie
 
Registered: Jul 2004
Posts: 26

Original Poster
Rep: Reputation: 15
What do u mean by a shadow program?

I can match a string from a file. that is OK. But how do i encrypt the password that i receive from the user. For that i'll need the encryption key which was used while encrypting the original password.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Qmail - Encrypted Passwords chrisfirestar Linux - Networking 9 06-25-2013 02:11 AM
Encrypted passwords on Cisco 2500 siawash Linux - Networking 5 08-10-2005 05:38 PM
Encrypted Passwords, how could I tell? wardialer Linux - Security 13 10-12-2004 02:14 PM
Moving encrypted passwords to a new host paulsm4 Linux - Software 1 09-17-2004 01:40 AM
creating encrypted passwords kidwired Linux - Security 3 01-12-2003 04:34 PM


All times are GMT -5. The time now is 06:27 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration