05-11-2008
Quote:
Originally Posted by
soliberus
Thanks for the response
I've now written a script that replaces the appropriate lines in /etc/shadow and it works fine.
I use expect:
#!/opt/bin/expect --
set password [lindex $argv 1]
spawn /bin/passwd [lindex $argv 0]
expect "Password:"
send "$password\r"
expect "Password:"
send "$password\r"
expect eof
set status [wait]
exit [lindex $status 3]
10 More Discussions You Might Find Interesting
1. Post Here to Contact Site Administrators and Moderators
Hi Moderators,
I forgot the login password and am accessing the forum page through save form password credentials.
Could you please reset my password ?
Thanks,
:) (5 Replies)
Discussion started by: matrixmadhan
5 Replies
2. UNIX for Advanced & Expert Users
Hi,
Is there any way to automate the reset of passwords.I mean can we write some scripts and do it. Would be great if anybody can help in this regards. (9 Replies)
Discussion started by: yakyaj
9 Replies
3. Shell Programming and Scripting
Is there anyway that I can reset user's password using a script/ssh command?
ie. emulate passwd command with a default password of abc123 or even null value?
> ssh server1 pwdadm user1 < /dev/null
or
> ssh server1 passwd user1 < /dev/null
neither worked for me.. but you know what I... (1 Reply)
Discussion started by: pdtak
1 Replies
4. Solaris
Hey all,
I'm looking for a script to auto-generate a password for users that forget their password.
Currently, we are using a perl script (with cgi-bin) where users update their password, but would like to add to this and make it so that the users can also request a password reset and a... (1 Reply)
Discussion started by: em23
1 Replies
5. Shell Programming and Scripting
Hi folks,
How can we reset the password via shell script...
How can i manage to pass password for the prompt.
gws000i010:/ # passwd test1
New Password: (1 Reply)
Discussion started by: bullz26
1 Replies
6. Shell Programming and Scripting
Hi all, Please suggest
I want to write a scritp which will send a email to my mail address before the time duration of the password reset,
Should write mail stating that your password will expire in so and so days""
Rgds:b:
Ann. (2 Replies)
Discussion started by: Haque123
2 Replies
7. Shell Programming and Scripting
Hi all,
I am using an command which reset the password for the user, its working fine on Solaris boxes but sometimes the samw was not happening on some of linux boxes.
/bin/echo username | passwd --stdin username
I am new to unix and shell scripting,so it would be very helpful for me... (1 Reply)
Discussion started by: sudharson
1 Replies
8. Shell Programming and Scripting
Hi All,
We have many number of users.Some times we will receive mail from them like ,
the below USER password got expired and they are requesting us to change the password and send it back to them in a mail. there we are giving Expiray date again.
We are doing this process manually. I want... (2 Replies)
Discussion started by: vasuvv
2 Replies
9. Shell Programming and Scripting
Hi,
I could like to change my remote system user password. Could you please guile me,
If you have any existing scripting there. please let me know
Thanks & Regards,
Mani (8 Replies)
Discussion started by: Mani_apr08
8 Replies
10. Forum Support Area for Unregistered Users & Account Problems
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
LEARN ABOUT OPENDARWIN
passwd
PASSWD(1) BSD General Commands Manual PASSWD(1)
NAME
passwd -- modify a user's password
SYNOPSIS
passwd [-i infosystem] [-l location] [name]
DESCRIPTION
Passwd changes the user's password. First, the user is prompted for their current password. If the current password is correctly typed, a
new password is requested. The new password must be entered twice to avoid typing errors.
The new password should be at least six characters long and not purely alphabetic. Its total length should be less than _PASSWORD_LEN (cur-
rently 128 characters) although some infosystems allow longer passwords. Numbers, upper case letters and meta characters are encouraged.
Once the password has been verified, passwd communicates the new password information to the authenticating host.
-i infosystem
This option specifies where the password update should be applied. Under Mac OS X 10.3, supported infosystems are:
netinfo
(default) The netinfo database containing the user's password. If no -l option is specified, the local netinfo database is
assumed.
file The local flat-files (included for legacy configurations).
nis A remote NIS server containing the user's password.
opendirectory
A system conforming to opendirectory APIs and supporting updates (including LDAP, netinfo, etc).
-l location
This option causes the password to be updated in the given location of the choosen infosystem. When changing only the local password,
pwd_mkdb(8) is used to update the password databases.
for netinfo,
location may be a domain name or server/tag
for file,
location may be a file name (/etc/master.passwd is the default)
for nis,
location may be a NIS domainname
for opendirectory,
location may be a directory node name
The super-user privilages are not required change a user's current password if only the local password is modified.
FILES
/etc/master.passwd The user database
/etc/passwd A Version 7 format password file
/etc/passwd.XXXXXX Temporary copy of the password file
SEE ALSO
chpass(1), login(1), passwd(5), pwd_mkdb(8), vipw(8,) nicl(1)
Robert Morris and Ken Thompson, UNIX password security.
HISTORY
A passwd command appeared in Version 6 AT&T UNIX.
4th Berkeley Distribution June 6, 1993 4th Berkeley Distribution