Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 06-24-2004, 04:10 PM   #1
Registered: Apr 2004
Distribution: Linux Red Hat
Posts: 141

Rep: Reputation: 15
need a script that can change the passwd


ok i need help in writing a script which will affect the passwd program.

my problem is that i have implemented the single sign on.

now i wanted my windows users to be able to change there passwords from linux boxes. so i changed the /etc/pam.d/passwd file. now it works fine but the problem is that if i try to change the password of a local user it prompts me twice for changing the NT password.although it also prompts me to change the unix password but why is the NT passowrd change being asked.

i want that some how the script should detect that the user is local and doesnt need to be called . only needs to be called.

here is my /pam.d/passwd file

auth sufficient
auth required service=system-auth use_first_pass

account sufficient
account required service=system-auth

password sufficient
password required service=system-auth

now what happens is that this works fine for a windows user. this is what happens

[LINWIN/maryam@niit158VM maryam]$ passwd
Changing password for user LINWIN/maryam
current) NT password:
Enter new NT password:
passwd: all authentication tokens updated successfully

now this is fine for a winodws user. password changed easily

now look at this for a local unix user.

[john@niit158VM root]$ passwd
Changing password for user john.
Changing password for john
(current) NT password:
(current) UNIX password:
Enter new NT password:
Retype new NT password:
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

THE BOLD LINES are where the problem is. even if the user is a local unix user the system still asks to change the NT password? although at the end the local user's password is changed but still i dont want this extra messages coming up?

how to get out of this?
Old 07-09-2004, 06:07 AM   #2
Registered: Oct 2003
Location: Switzerland (Europe)
Distribution: OpenSuSE, RedHat, Knoppix, IRIX + MacOSX
Posts: 198

Rep: Reputation: 31
How about do this with variables ?
Ask it once and then use
echo $user:$pass | /usr/sbin/chpasswd



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
NIS Change passwd problems.. HELP bubsgt95 Linux - Server 6 09-11-2009 09:21 AM
ow to create script change a user's password? passwd expects input from keyboard.. Arodef Linux - General 1 03-02-2005 11:40 PM
Initial passwd change liguorir Linux - Software 0 09-24-2004 12:01 PM
user can change passwd kelper Linux - Software 3 08-28-2003 05:17 AM
Change/import passwd for many users kelper Linux - General 1 08-26-2003 02:37 AM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:27 PM.

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