Change password script in Unix easily..


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Change password script in Unix easily..
# 1  
Old 11-14-2005
Change password script in Unix easily..

I have more than 50 server unix's password need to change, usually I assign one password for all hosts, for easy remember, but I need to change password every two months..it's very tried to change password every 2 months, is there any unix script that can change password easily?
ie ' script current_password new_password ' will auto change the password to 'new_password'...
# 2  
Old 11-14-2005
See: changepass automate password changes on multiple systems
# 3  
Old 11-14-2005
Thank for the script.
But I think the script may not suitable on my system, please see the result:
I jant want to find a script that can change password only in my current ssh server .... ie I just put the old & new password in the script and run it, then the script will auto change for me, since passwd ask many 4 times to verify the new password.




$ ./p
Enter Old Password-
Enter New Password-
Trying 202.xx.xx.xx...
Connected to 202.xx.xx.xx.
Escape character is '^]'.


Compaq Tru64 UNIX V5.1B (Rev. 2650) (abcd.ghlp.wer.kl) (pts/1)

login: s0153597
Password:
Last successful login for s0153597: Mon Nov 14 23:24:13 HKT 2005 from n219078003046.netvigator.com
Last unsuccessful login for s0153597: NEVER

s0153597> ./p[41]: Y: not found
touch changepassdatafile.202.xx.xx.xx
exit
Connection closed by foreign host.
Connected to 202.xx.xx.xx.
220 abcd.ghlp.wer.kl FTP server (Compaq Tru64 UNIX Version 5.60) ready.
331 Password required for s0153597.
230 User s0153597 logged in.
200 PORT command successful.
150 Opening ASCII mode data connection for changepassdatafile.202.xx.xx.xx (202.xx.xx.xx,2020) (0 bytes).
226 Transfer complete.
221 Goodbye.
202.xx.xx.xx was ok
Trying 202.xx.xx.xx...
Connected to 202.xx.xx.xx.
Escape character is '^]'.


Compaq Tru64 UNIX V5.1B (Rev. 2650) (abcd.ghlp.wer.kl) (pts/1)

login: s0153597
Password:
Last successful login for s0153597: Mon Nov 14 23:39:21 HKT 2005 from abcd.ghlp.wer.kl
Last unsuccessful login for s0153597: NEVER

s0153597> passwd
Old password:
Last successful password change for s0153597: Tue Oct 4 18:24:53 HKT 2005
Last unsuccessful password change for s0153597: Mon Nov 14 23:31:38 HKT 2005


Do you want (choose one option only):

1 Pronounceable passwords generated for you
2 A string of characters generated for you
3 A string of letters generated for you
4 To pick your password

Select ONE item by number: 12345678

** Invalid choice: 12345678

Do you want (choose one option only):

1 Pronounceable passwords generated for you
2 A string of characters generated for you
3 A string of letters generated for you
4 To pick your password

Select ONE item by number: 12345678

** Invalid choice: 12345678

Do you want (choose one option only):

1 Pronounceable passwords generated for you
2 A string of characters generated for you
3 A string of letters generated for you
4 To pick your password

Select ONE item by number: exit

** Invalid choice: exit

Do you want (choose one option only):

1 Pronounceable passwords generated for you
2 A string of characters generated for you
3 A string of letters generated for you
4 To pick your password

Select ONE item by number: $
$
$
# 4  
Old 11-14-2005
Not an expert, or even an intermediate just a noob but...

Why not just make it so that the script runs 8 different times each time selecting 1 then 2 then 3 etc. Not sure if thats what your looking to do or even if that has anything to do with the problem just trying to throw out suggestions to see if im right just so i can familiarize myself with different things sorta. Sorry if it doesnt work. Smilie
# 5  
Old 11-14-2005
As I said in my post I tested my script on HP-UX and Solaris only. And I was using the standard vendor supplied passwd program. It is not going to work with any program called "passwd" regardless of what user interaction is required. Since you have a different version of passwd, you will need to modify my script to work with your passwd program.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Forum Support Area for Unregistered Users & Account Problems

Password sent via reset password email is 'weak' and won't allow me to change my password

I was unable to login and so used the "Forgotten Password' process. I was sent a NEWLY-PROVIDED password and a link through which my password could be changed. The NEWLY-PROVIDED password allowed me to login. Following the provided link I attempted to update my password to one of my own... (1 Reply)
Discussion started by: Rich Marton
1 Replies

2. Shell Programming and Scripting

Script to change password in UNIX

Hi Friends, Every morning i need to change the password, please advise how it can be automated. I am having pre planned password list for 4 months which can be used as input file for new passwords. Thanks (28 Replies)
Discussion started by: rajjev_saini123
28 Replies

3. HP-UX

Automatic script to change the UNIX Password

Hi, we have around 50 users and every month we need to change the password manually once its expire. do we have any script to change the password automatically. OS -HP-UX Thanks in advance.. (6 Replies)
Discussion started by: periyasamycse
6 Replies

4. HP-UX

[Solved] Howto change subdirectory easily using cd

Hi all, how to change the path easily from /u01/oracle/oradata/newdb/tab >cd olddb /u01/oracle/oradata/olddb/tab > or /u01/oracle/oradata/newdb/tab >cd u05 /u05/oracle/oradata/newdb/tab > I am lazy for typing the abs. path again... As I know there is some "tips" in doing this. ... (2 Replies)
Discussion started by: freddy1228
2 Replies

5. Shell Programming and Scripting

Unix script to change password

Hello Gurus I have little challenge which I do not know how to address it. I have unix account on many servers (let's say over 25). These accounts expire every 60 days. Is there scripts that I can run from my "local computer" and pass a new password to it where it would change it for me on all... (7 Replies)
Discussion started by: nimo
7 Replies

6. UNIX for Dummies Questions & Answers

Where to change the UNIX password prompt?

Hi guys, I got these 3 servers: a, b and c which I ssh from a to b/c. a:$ ssh userid@b Password: a:$ ssh userid@c userid@c's password: Notice that the password prompt is different (highlighted in bold) on both servers even though their SUN Solaris version the same, OpenSSH version... (0 Replies)
Discussion started by: DrivesMeCrazy
0 Replies

7. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

8. Shell Programming and Scripting

Script to change UNIX password

My shop has just ordained that all UNIX passwords expire after 45 days. We do NOT have a "single logon" facility, so I will need to logon to each of the servers (15+) I interact with and change my password by hand. I thought I could invoke passwd inside a ksh script as a Here document and... (12 Replies)
Discussion started by: kornshellmaven
12 Replies
Login or Register to Ask a Question