Sponsored Content
Top Forums UNIX for Advanced & Expert Users Automating Interactive password change Post 302572879 by dr46014 on Friday 11th of November 2011 12:36:15 PM
Old 11-11-2011
i tried with exit but still its not working.

Below is the error :
Code:
$spawn ./ldap_pwd_prompt.ksh
sh: /usr/local/bin/stty: not found
Enter existing login password:
New Password:
Re-enter new Password:
Permission denied

and it does not go to the prompt again.
Code:
#!/usr/local/bin/expect
set timeout 10
set curpass [lindex $argv 0]
set newpass [lindex $argv 1]
spawn ./ldap_pwd_prompt.ksh
expect "Enter existing login password:"
send "$curpass\r"
expect "New Password:"
send "$newpass\r"
expect "Re-enter new Password:"
send "$newpass\r"
expect eof
exit;

Moderator's Comments:
Mod Comment Video tutorial on how to use code tags in The UNIX and Linux Forums.

Last edited by vbe; 11-11-2011 at 01:51 PM.. Reason: typos
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Automating interactive scripts

Hi all, I am trying to write a program that will automate interactive scripts that use 'pkgadd'. Easily enough I can use 'pkgask' and a response file for most of what I want to do, but unfortunately there are parts of some pkg installations that are configured to only take input from /dev/tty!!... (2 Replies)
Discussion started by: bookoo
2 Replies

2. Shell Programming and Scripting

automating password ?

Hi all, I want to write a script which logs into a database (DB2). To do this i need to have a password. This will be done lots and lots of times, so i need to modify the script to automate the response to the password request. How do i this, because at present i do the following: db2 connect... (3 Replies)
Discussion started by: Liamo
3 Replies

3. UNIX for Dummies Questions & Answers

Automating password change

Hi, I'm trying to create a shell to change some user password with random string. I've tried to use stdin redirection to supply the new password by a response file: passwd theuser < respfile but I continue to be prompted for supplying pwd via console keyboard. Can you help me to... (2 Replies)
Discussion started by: nisant
2 Replies

4. Solaris

Non-interactive password change?

Does anyone know how I can do a non-interactive password change in Solaris 8 and 10? Using Sed to edit the passwd file, or Expect to automate the process has already been considered.... I'm looking for something more direct. Your guidance is appreciated. akbar (2 Replies)
Discussion started by: akbar
2 Replies

5. Shell Programming and Scripting

automating ssh session with password

Hi Can anyone help me in automate a ssh session with password using shell script (7 Replies)
Discussion started by: raghav288
7 Replies

6. Shell Programming and Scripting

Automating Interactive script

I have a script that will install software on all remote host. At the end of the script it starts the install.sh part and goes into a interactive mode asking Yes or No questions and prompting to add a username and password. My question is how can I script this so that these questions are... (7 Replies)
Discussion started by: soupbone38
7 Replies

7. Shell Programming and Scripting

automating username / password entry

I have a database that contains a list of server names, and the password for the root user on several servers (100+). I need to verify the passwords for each of the servers in an automated fashion because the database continues to grow. All of the users that I'm going to test are ROOT. I can't... (1 Reply)
Discussion started by: jbeck22
1 Replies

8. Shell Programming and Scripting

Automating an interactive process with EOF string

Hello, I'm running Stockfish chess engine ( Home - Stockfish - Open Source Chess Engine ) CLI on Linux in interactive mode which is working fine. root@ubuntu1950x:~# ./stockfish Stockfish 080218 64 POPCNT by T. Romstad, M. Costalba, J. Kiiski, G. Linscott setoption name Debug Log File... (2 Replies)
Discussion started by: prvnrk
2 Replies

9. UNIX for Beginners Questions & Answers

Automating UNIX/Solaris password resets

Hi, we are running solaris 5.10 and looking for solutions to automate password resets? Plz assist. Thanks, Sridhar (6 Replies)
Discussion started by: chvgms
6 Replies

10. 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
Text::Password::Pronounceable(3pm)			User Contributed Perl Documentation			Text::Password::Pronounceable(3pm)

NAME
Text::Password::Pronounceable - Generate pronounceable passwords SYNOPSIS
# Generate a pronounceable password that is between 6 and 10 characters. Text::Password::Pronounceable->generate(6, 10); # Ditto my $pp = Text::Password::Pronounceable->new(6, 10); $pp->generate; DESCRIPTION
This module generates pronuceable passwords, based the the English digraphs by D Edwards. METHODS new $pp = Text::Password::Pronounceable->new($min, $max); $pp = Text::Password::Pronounceable->new($len); Construct a password factory with length limits of $min and $max. Or create a password factory with fixed length if only one argument is provided. generate $pp->generate; $pp->generate($len); $pp->generate($min, $max); Text::Password::Pronounceable->generate($len); Text::Password::Pronounceable->generate($min, $max); Generate password. If used as an instance method, arguments override the factory settings. HISTORY
This code derived from mpw.pl, a bit of code with a sordid history. o CPAN module by Chia-liang Kao 9/11/2006. o Perl cleaned up a bit by Jesse Vincent 1/14/2001. o Converted to perl from C by Marc Horowitz, 1/20/2000. o Converted to C from Multics PL/I by Bill Sommerfeld, 4/21/86. o Original PL/I version provided by Jerry Saltzer. LICENSE
Copyright 2006 by Best Practical Solutions, LLC. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <http://www.perl.com/perl/misc/Artistic.html> perl v5.10.1 2010-08-16 Text::Password::Pronounceable(3pm)
All times are GMT -4. The time now is 06:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy