Change user password using shell script

  • Follow


Hi,

How can i change user password on solaris os using shell script or any
other program.(Without using expect script)

0
Reply gogdanivb (1) 4/14/2006 10:17:23 AM

In article <1145009843.325125.65520@j33g2000cwa.googlegroups.com>,
 "Gogdanivb" <gogdanivb@yahoo.co.in> wrote:

> Hi,
> 
> How can i change user password on solaris os using shell script or any
> other program.(Without using expect script)

Since the passwd command specifically doesn't permit this as a security 
feature, you can't.

You'll have to write a c program or use something like perl emulating 
what passwd does.  If you can't use expect, I see no other way.

"How's that working for you?  Good luck with that"--Dr. Phil

-- 
DeeDee, don't press that button!  DeeDee!  NO!  Dee...



0
Reply Michael 4/14/2006 6:52:54 PM


This one-line perl script generates crypt(3C) strings...

#!/usr/bin/perl -w
# usage:    makepw password salt
#           "salt" is any two character string chosen from the set
[a-zA-Z0-9./]
# example:  makepw opENupwd a7
#           a7GGiQHDf8Auo
if ($#ARGV < 1) { print "usage: makepw.pl pwstring salt\n"; exit; }
printf("%s\n", crypt($ARGV[0], $ARGV[1]));

0
Reply jayl 4/14/2006 9:57:17 PM

Gogdanivb schrieb:
> Hi,
> 
> How can i change user password on solaris os using shell script or any
> other program.(Without using expect script)
> 

openssl or apg can generate des and md5 hashes of passwords.
With a simple sed script you can insert a des or md5 hash in 
/etc/shadow, but you must take care for an simultanous running passwd or 
similar, solaris dont have a vipw, or has it somewhere? Does anybody 
know how solaris take care for simultanous running passwd? Take a look 
at the source browser at opensolaris.com...
0
Reply Wolfgang 4/29/2006 8:34:42 PM

3 Replies
1456 Views

(page loaded in 0.08 seconds)

Similiar Articles:













7/20/2012 9:17:19 PM


Reply: