LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 04-22-2010, 11:05 AM   #1
dave12
LQ Newbie
 
Registered: Apr 2010
Posts: 7

Rep: Reputation: 0
Script to check password security


Hi,

Im trying to make a script that will test the suitability of a password. I understand that all the features I want are in the /etc/pam.d/common-password file. From here I can change the length of a password, what characters must be in a password, if the words are in the dictionary, etc... but I don't know how to change these values by using a script. I want it in a script because I want to be able to suggest a more suitable password if the original password doesn't meet the criteria.

Cheers
Dave
 
Old 04-22-2010, 11:08 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,318

Rep: Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881Reputation: 3881
Quote:
Originally Posted by dave12 View Post
Hi,

Im trying to make a script that will test the suitability of a password. I understand that all the features I want are in the /etc/pam.d/common-password file. From here I can change the length of a password, what characters must be in a password, if the words are in the dictionary, etc... but I don't know how to change these values by using a script. I want it in a script because I want to be able to suggest a more suitable password if the original password doesn't meet the criteria.

Cheers
Dave
Ok...you've said what you want, but what is your question? What are you having problems with? What have you written so far?

We'll be glad to help you with a script, but I doubt anyone is going to write it for you. Post what you've written, and where you're getting stuck, and we can assist.
 
Old 04-22-2010, 11:25 AM   #3
dave12
LQ Newbie
 
Registered: Apr 2010
Posts: 7

Original Poster
Rep: Reputation: 0
sorry, here's what I have so far.

#!/bin/sh


echo "password required pam_cracklib.so \ minlen=6 dcredit=-1 ucredit=-1
password required pam_unix.so use_authok obscure md5 " > /etc/pam.d/common-password

This works, it changes the file to the above contents. I think i'm just confusing myself. I need to check this works against a password and if the password doesn't match these criteria I want to suggest an alternative.
 
Old 04-22-2010, 11:33 AM   #4
dave12
LQ Newbie
 
Registered: Apr 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Sorry again,

This wasnt a very good post. I don't think im going about it the right way. I need a script to give an alternative if the password doesn't meet the criteria. This script will just change the file and if I offer an alternative password in here I don't think it will work because this script won't be run everytime a new password is entered. Could anyone point me in the right direction?
 
  


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
Network security check and root password change (London, England) andypandy LQ Job Marketplace [Archive] 7 01-13-2009 07:38 PM
Check userid/password from a script/program johann_p Programming 6 11-09-2006 06:09 AM


All times are GMT -5. The time now is 05:26 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