LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 06-08-2008, 05:12 AM   #1
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Rep: Reputation: 107Reputation: 107
Unhappy change password in one go


Hi all,

I need to change the password of any user in one go.

For example in Linux we have two options :-

Code:
(echo "username:password") | chpasswd
or
echo $PASS | passwd $USER --stdin
This changes the password without prompting. Actually, I need to make a script which adds a user and then sets a password to it.

I have made it for Linux but now I require it to run on other Unix boxes also. I dont have option to install any other utility like expect.

Pls can someone give Solaris equivalent of the command.

Thanks in adv.

VIKAS
 
Old 06-08-2008, 06:12 AM   #2
ehawk
Senior Member
 
Registered: Jul 2003
Posts: 1,257

Rep: Reputation: 48
http://www.ussg.iu.edu/usail/man/solaris/passwd.1.html

In files case, super-users (for instance, real and effective
uid equal to zero, see id(1M) and su(1M)) may change any
password; hence, passwd does not prompt privileged users for
the old password. Privileged users are not forced to comply
with password aging and password construction requirements.
A privileged user can create a null password by entering a
carriage return in response to the prompt for a new pass-
word. (This differs from passwd -d because the "password"
prompt will still be displayed.)

http://www.informit.com/articles/art...26523&seqNum=6

Root and Password Changes

The root user is permitted to change the password for any user. When root changes a user's password, the passwd command does not prompt for the old password. This permits root to "reset" a user's password in circumstances when the user has forgotten his or her password. This also permits root to lock a user's account by changing the user's password to a value that the user is unlikely to guess.

Last edited by ehawk; 06-08-2008 at 06:15 AM.
 
Old 06-08-2008, 06:13 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint, Tribblix
Posts: 9,754

Rep: Reputation: 457Reputation: 457Reputation: 457Reputation: 457Reputation: 457
Use a network based user/password management like NIS or LDAP and you are set.

See also: http://www.linuxquestions.org/questi...prompt-646675/

Last edited by jlliagre; 06-08-2008 at 06:21 AM.
 
Old 06-08-2008, 06:29 AM   #4
ehawk
Senior Member
 
Registered: Jul 2003
Posts: 1,257

Rep: Reputation: 48
From:

http://www.fantasticunix.com/forum/g...assword-2.html

This seems to be a little difficult because of the lack of useradd
 
Old 06-08-2008, 06:48 AM   #5
ehawk
Senior Member
 
Registered: Jul 2003
Posts: 1,257

Rep: Reputation: 48
Check out the perl script on this page:

http://aa11.cjb.net/sun_managers/1998/10/msg00411.html

Also, see:

http://www.softpanorama.org/Utilities/chpasswd.shtml

Last edited by ehawk; 06-08-2008 at 06:49 AM.
 
Old 06-08-2008, 04:38 PM   #6
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
I've merged similar threads. vikas027, please avoid posting the same question in multiple threads.
 
Old 06-08-2008, 11:16 PM   #7
ehawk
Senior Member
 
Registered: Jul 2003
Posts: 1,257

Rep: Reputation: 48
Well, I can kinda understand...they are posted to different forums (solaris, hp-ux, aix)...people might ignore one and comment on another based on their knowledge/experience...covering bases...if he posted to a single, more general forum, poweruses with the respective OSs might bypass it altogether. Very similar, true, but wasn't a "bad faith" of multi-posting, I don't think (reasonable explanation exists).
 
Old 06-09-2008, 01:29 AM   #8
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Original Poster
Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by reddazz View Post
I've merged similar threads. vikas027, please avoid posting the same question in multiple threads.
I did so because all belong to different OS.

still, will take care in future.
 
Old 06-09-2008, 02:09 AM   #9
ehawk
Senior Member
 
Registered: Jul 2003
Posts: 1,257

Rep: Reputation: 48
If you have not found a solution yet, consider posting to justlinux.com
 
Old 06-09-2008, 02:10 AM   #10
ehawk
Senior Member
 
Registered: Jul 2003
Posts: 1,257

Rep: Reputation: 48
If you have not found a solution yet, consider posting to justlinux.com

Also, I would guess that there are dedicated solaris, hp-ux, and aix help sites/forums
 
Old 06-09-2008, 05:59 AM   #11
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Original Poster
Rep: Reputation: 107Reputation: 107
Thanks ehawk, will post there too.
 
  


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
how to change root password without knowing the grub password ramesh.mimit Red Hat 8 10-15-2011 06:12 AM
change Root Password even if the password in the grub is also set sheelnidhi Linux - General 6 08-30-2006 08:27 AM
How can I change e-mail password(or linux account password) with php in website?? yusuf Programming 1 05-28-2004 10:39 AM
Just change Samba password, not Unix password? sorrodos Linux - Networking 1 08-14-2003 08:52 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 11:00 AM.

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