BSD Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsBSD Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 3rd, 2008, 02:36 PM
DRiggs DRiggs is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 3 DRiggs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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!

Reply With Quote
  #2  
Old July 3rd, 2008, 10:07 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 9th Plane (9000 - 9499 posts)
 
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
Posts: 9,406 Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 10 h 18 m 59 sec
Reputation Power: 4080
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

Reply With Quote
  #3  
Old July 7th, 2008, 10:01 AM
DRiggs DRiggs is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 3 DRiggs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #4  
Old July 7th, 2008, 11:44 AM
DRiggs DRiggs is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 3 DRiggs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsBSD Help > Password change ksh script not working...

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap