LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-08-2009, 01:49 AM   #1
toredo
Member
 
Registered: Feb 2009
Posts: 83

Rep: Reputation: 25
check user password


hello,

i search for a way to check a user password. i know the passwords are saved in /etc/shadow, but i can't regenerate and compare them.

i prfer c/c++, but if it much easier i can use perl or shell script to.

please help me.

best regards
toredo
 
Old 12-08-2009, 01:57 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

What's the reason why you want to 'check' user passwords? They are personal and private and trying to find out another persons password by means other then asking that user, is considered hacking in my opinion. If you want to control the password strength of a user's password then you'll have to imply the use of it on your system, using for example pam modules like pam_cracklib.

You can read up on it here.

Kind regards,

Eric
 
Old 12-08-2009, 02:13 AM   #3
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
The system is designed so that you do not need to regenerate passwords in order to check them. Instead you use the crypt function to encrypt the password that is input, and compare it against the encrypted value in the /etc/shadow file.

Last edited by neonsignal; 12-08-2009 at 02:15 AM.
 
Old 12-08-2009, 02:33 AM   #4
toredo
Member
 
Registered: Feb 2009
Posts: 83

Original Poster
Rep: Reputation: 25
Quote:
Originally Posted by EricTRA View Post
Hello,

What's the reason why you want to 'check' user passwords? They are personal and private and trying to find out another persons password by means other then asking that user, is considered hacking in my opinion. If you want to control the password strength of a user's password then you'll have to imply the use of it on your system, using for example pam modules like pam_cracklib.

You can read up on it here.

Kind regards,

Eric
sry, my english is bad, but i wouldn't crack the password. no i would only check a password for a user (is a litle bit like sudo).

@neonsignal
thx, i'll try it. thx

best regards
toredo
 
Old 12-08-2009, 03:57 AM   #5
mohit_parihar
LQ Newbie
 
Registered: Nov 2009
Posts: 28

Rep: Reputation: 15
hello
right now a i am working on foreground(fg) & background (bg),so kindly provide me source code for fg & bg command.
 
Old 12-08-2009, 04:12 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Both are part of the job control system that comes with the shell (Job Control). If you want the source code then look at a site like http://www.linuxfromscratch.com. They have links to all the packages to build a Linux system from scratch, so also for the shell.

Kind regards,

Eric
 
1 members found this post helpful.
  


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
How can i check a string with actual user passwd (ie password in /etc/shadow) iamjayanth Linux - Software 6 09-29-2009 01:34 AM
simpler GUI password for Administrative tasks while retaining complex user password? workforfood Ubuntu 1 08-29-2009 06:48 AM
Locking out a user when password expires, but allowing them to change their password kaplan71 Linux - Security 5 06-27-2008 07:12 PM
how to check the password expiry date of a user? binary_0011 Other *NIX 1 06-04-2008 01:37 AM
Add a user with no password/or user pick password. knockout_artist Linux - Newbie 2 11-26-2007 09:08 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:30 PM.

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