03-19-2009
ksh script to change passwd
Hello All,
I am trying to change a user passwd (one time password):
cat /tmp/passwd
mnop1234
mnop1234
#passwd abcd < /tmp/passwd
(for some reason, it is not able to input the password from /tmp/passwd and comes back with "New Password: ")
Is there a work around except using "expect".
thank you.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Group,
Can anyone assist me with this?
I am on AIX 5.2 ML06. I create the user and assign a passwd. But I do not want the user to change the passwd at all. I like him/her to use the passwd that I have set for him/her. Any ideas would be highly appreciated!!!
Thanks. (3 Replies)
Discussion started by: brookingsd
3 Replies
2. UNIX for Dummies Questions & Answers
I booted up Sun V240 server with boot cdrom -s using the Sun Operating System CD. I now am at the # prompt and su - root . The system will not allow me to set password for root. Get following error:
# passwd
New Password: xxxxxxxx
Re-enter new Password: xxxxxxxx
passwd: Unexpected failure. ... (4 Replies)
Discussion started by: mayewil
4 Replies
3. UNIX for Advanced & Expert Users
i'm trying to change passwd remotely in unix (solaris) and tried using "expect" but it is not working.
Any ideas to change the passwd remotely using a shell script? (1 Reply)
Discussion started by: pharos467
1 Replies
4. Shell Programming and Scripting
Hello *nix users,
I'm wondering if there's a way to change a user's default shell in /etc/passwd to the telnet program along with some parameters.
For instance:
user:x:1001:1001::/home/user:/usr/bin/telnet localhost 12345
The above line in the /etc/passwd file gives the following error... (2 Replies)
Discussion started by: tux0084
2 Replies
5. Solaris
Hi,
I need to Change passwd for bulk servers using SSH script.
I have one server, from which i can reach all the servers without password via SSH.
There is some expect script, from which i can achieve it.
Can any one help me out here.
Thanks in advance.
Vicky (1 Reply)
Discussion started by: vickyingle5
1 Replies
6. Shell Programming and Scripting
Hi,
I am new to UNIX and shell scripting.
I have to create a shell script(ksh) which parses log4j.xml file for a given webservice name and change the corresponding value from INFO to DEBUG or vice-versa.
My log4j.xml looks like:-
<!-- Appender WEBSERVICENAME-->
<appender... (3 Replies)
Discussion started by: sanjeevcseng
3 Replies
7. Shell Programming and Scripting
Hi All,
I wanted to write a shell script which will change the expired passwd in oracle. Here is below what I am trying,
#!/bin/sh
set -x
ORACLE_HOME="/optware/oracle/9.2.0.2_64"
SQLPLUS="${ORACLE_HOME}/bin/sqlplus"
PASS="xyz"
PATH=$ORACLE_HOME/bin:$PATH... (0 Replies)
Discussion started by: gr8_usk
0 Replies
8. Shell Programming and Scripting
Hi All,
From Audit point of view, I need to add a script to my production Solaris servers. That should be able to mail me, if any user is added or removed.
That means, I should get a mail, what user is deleted or added in /etc/passwd, i.e. if there is a change in this file, I should be... (8 Replies)
Discussion started by: solaris_1977
8 Replies
9. Solaris
bash-3.00# passwd sami
New Password:
Re-enter new Password:
Dec 14 00:07:43 hack passwd: passwdutil: crypt_gensalt Invalid argument
passwd: Unexpected failure. Password database unchanged.
Permission denied
i got this error while i am change the user(sami) passwd. (3 Replies)
Discussion started by: samiulla
3 Replies
10. Solaris
Have an issue with a user or root changing the user's passwd.
We run the passwd command and a complex passwd is entered a message is displayed,
"passwd is based on a dictionary word."
We do have a dictionary file and I know for a fact the complex passwd is not in the list. This happens on a... (3 Replies)
Discussion started by: solizkewl
3 Replies
LEARN ABOUT MOJAVE
pwd_mkdb
PWD_MKDB(8) BSD System Manager's Manual PWD_MKDB(8)
NAME
pwd_mkdb -- generate the password databases
SYNOPSIS
pwd_mkdb [-c] [-p | -s] [-d directory] [-u username] file
DESCRIPTION
pwd_mkdb creates db(3) style secure and insecure databases for the specified file. These databases are then installed into /etc/spwd.db and
/etc/pwd.db, respectively. The file is installed into /etc/master.passwd. The file must be in the correct format (see passwd(5)). It is
important to note that the format used in this system is different from the historic Version 7 style format.
The options are as follows:
-c Check if the password file is in the correct format. Do not change, add, or remove any files.
-d directory
Operate in a base directory other than the default of /etc. All absolute paths (including file) will be made relative to directory.
Any directories specified as a part of file will be stripped off. This option is used to create password databases in directories
other than etc; for instance in a chroot(8) jail.
-p Create a Version 7 style password file and install it into /etc/passwd.
-s Only update the secure version of the database. This is most commonly used in conjunction with the -u flag during a password change.
Because the insecure database doesn't contain the password there is no reason to update it if the only change is in the password
field. Cannot be used in conjunction with the -p flag.
-u username
Only update the record for the specified user. Utilities that operate on a single user can use this option to avoid the overhead of
rebuilding the entire database. This option must never be used if the line number of the user's record in /etc/master.passwd has
changed.
file The absolute path to a file in master.passwd format, as described in passwd(5).
The two databases differ in that the secure version contains the user's encrypted password and the insecure version has an asterisk ('*').
The databases are used by the C library password routines (see getpwent(3)).
pwd_mkdb exits zero on success, non-zero on failure.
FILES
/etc/master.passwd current password file
/etc/passwd a Version 7 format password file
/etc/pwd.db insecure password database file
/etc/pwd.db.tmp temporary file
/etc/spwd.db secure password database file
/etc/spwd.db.tmp temporary file
SEE ALSO
chpass(1), passwd(1), db(3), getpwent(3), passwd(5), vipw(8)
STANDARDS
Previous versions of the system had a program similar to pwd_mkdb, mkpasswd, which built dbm(3) style databases for the password file but
depended on the calling programs to install them. The program was renamed in order that previous users of the program not be surprised by
the changes in functionality.
BUGS
Because of the necessity for atomic update of the password files, pwd_mkdb uses rename(2) to install them. This, however, requires that the
file specified on the command line live on the same file system as the /etc directory.
There are the obvious races with multiple people running pwd_mkdb on different password files at the same time. The front-ends to pwd_mkdb,
chpass(1), passwd(1), and vipw(8) handle the locking necessary to avoid this problem.
BSD
June 6, 1993 BSD