Sponsored Content
Top Forums UNIX for Advanced & Expert Users Change password script in Unix easily.. Post 89571 by zp523444 on Monday 14th of November 2005 10:49:23 AM
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: $
$
$
 

8 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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
lchage(1)						      General Commands Manual							 lchage(1)

NAME
lchage - Display or change user password policy SYNOPSIS
lchage [OPTION]... user DESCRIPTION
Displays or allows changing password policy of user. OPTIONS
-d, --date=days Set the date of last password change to days after Jan 1 1970. Set days to -1 to disable password expiration (i.e. to ignore --mindays, and --maxdays and related settings). Set days to 0 to enforce password change on next login. (This also disables password expiration until the password is changed.) -E, --expire=days Set the account expiration date to days after Jan 1 1970. Set days to -1 to disable account expiration. -i, --interactive Ask all questions when connecting to the user database, even if default answers are set up in libuser configuration. -I, --inactive=days Disable the account after days after password expires (after the user is required to change the password). Set days to -1 to keep the account enabled indefinitely after password expiration. -l, --list Only list current user's policy and make no changes. -m, --mindays=days Require at least days days between password changes. Set days to 0 or -1 to disable this requirement. If this value is larger than the value set by --maxdays, the user cannot change the pasword. -M, --maxdays=days Require changing the password after days since last password change. Set days to -1 to disable password expiration. -W, --warndays=days Start warning the user days before password expires (before the user is required to change the password). Set days to 0 or -1 to disable the warning. EXIT STATUS
The exit status is 0 on success, nonzero on error. NOTES
Note that "account expiration" (set by --expire) is distinct from "password expiration" (set by --maxdays). Account expiration happens on a fixed date regardless of password changes. Password expiration is relative to the date of last password change. libuser Nov 8 2012 lchage(1)
All times are GMT -4. The time now is 08:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy