LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-24-2004, 03:10 PM   #1
bahadur
Member
 
Registered: Apr 2004
Distribution: Linux Red Hat
Posts: 141

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


Hi,

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 pam_winbind.so doesnt need to be called . only pam_stack.so needs to be called.


here is my /pam.d/passwd file


auth sufficient pam_winbind.so
auth required pam_stack.so service=system-auth use_first_pass

account sufficient pam_winbind.so
account required pam_stack.so service=system-auth

password sufficient pam_winbind.so
password required pam_stack.so 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, 05:07 AM   #2
fluppi
Member
 
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

Hth
Fluppi
 
  


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

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

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