The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Operating Systems
> BSD Help
|
Password change ksh script not working...
Discuss Password change ksh script not working... in the BSD Help forum on Dev Shed. Password change ksh script not working... BSD Help forum discussing all BSD based operating systems including FreeBSD, OpenBSD, NetBSD, and more. BSD refers to the distribution of UNIX originally developed by the University of California at Berkeley.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

July 3rd, 2008, 02:36 PM
|
|
Registered User
|
|
Join Date: Jul 2008
Posts: 3
Time spent in forums: 45 m 13 sec
Reputation Power: 0
|
|
|
Password change ksh script not working...
OK, I am new to FreeBSD and I am trying to use the chpass command in a scipt to change my passwords. I can use the "chpass -p 'encrypted password' userid" command to change the password, but it does not work within my script. The bigger problem is it DOES change the password, just not to what it should be... Any ideas???
Thanks in advance!
|

July 3rd, 2008, 10:07 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
|
Where are you calling this script from? Is it possible that PATH is not set in that environment and hence it is not finding chpass?
Also, you're passing the encrypted password to the script, not the password to encrypt, correct?
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
|

July 7th, 2008, 10:01 AM
|
|
Registered User
|
|
Join Date: Jul 2008
Posts: 3
Time spent in forums: 45 m 13 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by Scorpions4ever Where are you calling this script from? Is it possible that PATH is not set in that environment and hence it is not finding chpass?
Also, you're passing the encrypted password to the script, not the password to encrypt, correct? |
Thanks for the reply. Here are the answers:
1.) Currently, I am just running it through a telnet session. I am using the same telnet session to issue the command successfully. Also, it is changing the password, just to something I do not know...
2.) Yes, I am feeding the command the encrypted password. It is the same encrypted password I am feeding the command when successful on the telnet prompt.
Also, I actually narrowed down the problem. I am getting the encrypted password from a file (which contains a list of passwords). This is what is causing the problem. If I do not use a variable for the encrypted password, it works properly. Anyone know how I can fix this? I really need to grab this information from another file.
Thanks in advance!!!
Last edited by DRiggs : July 7th, 2008 at 11:32 AM.
Reason: More Information
|

July 7th, 2008, 11:44 AM
|
|
Registered User
|
|
Join Date: Jul 2008
Posts: 3
Time spent in forums: 45 m 13 sec
Reputation Power: 0
|
|
|
OK, I figured this out, so I thought I would post my solution for anyone else who is having this issue. I was using single quotes around the encrypted password since the password contained special characters ($,/, etc). Once I removed these single quotes the script is working fine. Thank you all for your help with this issue, and hopefully this post will help someone else.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|