Trying to understand EXPECT, so I created a script to add in new users.
The code below works without expect, and I can manually change the passwords for the new users.
However, if I use EXPECT (which is installed) to set passwords it creates the users but no passwords.
Both scripts are executable.
Expect Script
Output
I take it this is something to do with expect, maybe I have not understood it correctly, maybe I am picking the wrong spawn... I am not sure, as I have never used it before, but what I have read seems I have most of it correct.
Hello all,
It's been a few years since I touched 'expect' and just got it on my system.
In the past, I could simply do the following:
(this is just a simple example)
$ expect
$ ls -l
$ pwd
$ exit
...then a default script name would be placed in my working directory. At this point I... (2 Replies)
I need to run a remote application(GUI) in a client.i.e on running a script in the client machine i should get the GUI application which is running in the server by providing password through the script.Will expect or autoexpect command suit for this scenario?
could anyone help me by posting some... (0 Replies)
Hello to all...this is my first post (so please go easy). :)
I feel pretty solid at expect scripting, but I'm running into an issue that I'm not able to wrap my head around. I wrote a script that is a little advanced for logging into a remote Linux machine and changing text in a file using sed.... (2 Replies)
This Expect script provides expect with a list of IP addresses to Cisco IPS sensors and commands to configure Cisco IPS sensors. The user, password, IP addresses, prompt regex, etc. have been anonymized. In general this script will log into the sensors and send commands successfully but there are... (1 Reply)
Hello All,
I am trying to automate an installation process using expect and sh script. My problem is that during the installation process the expected value can change according to the situation.
For Example if this is a first time installation then at step 3 I'll get "Do you want to accept... (0 Replies)
Hi,
Am very new to expect scripting..
Can You please suggest me how to call an expect script inside another expect script..
I tried with
spawn /usr/bin/ksh
send "expect main.exp\r"
expect $root_prompt
and
spawn /usr/bin/ksh
send "main.exp\r"
expect $root_prompt
Both... (1 Reply)
I have a simple Expect script to power a system on and off in an endless loop looking for an ERROR message at which point the script should exit. But I need to skip the first 60 seconds after each power on or off and not exit if there are ERROR messages during that time. I thought I could use... (0 Replies)
the following code works sometimes. other times, it behaves mysteriously. when the script sshs to a box, it is suppose to automatically begin running the command it is told to run. but in this case, after this script logs into a host, it just sits there at the prompt and does not run the... (1 Reply)
I'm fairly new to scripting so this might not be possible.
I am using Expect with Cisco switches and need to capture the string after finding the expect request. For example, when I issue "show version" on a Nexus switch, I'm looking to capture the current firmware version:
#show version
... (0 Replies)
Discussion started by: IBGaryA
0 Replies
LEARN ABOUT SUSE
chpasswd
chpasswd(8) System Manager's Manual chpasswd(8)NAME
chpasswd - change user passwords in batch
SYNOPSIS
chpasswd [-D binddn] [-P path] [-c des|md5|blowfish | -e] [file]
DESCRIPTION
chpasswd changes passwords for user accounts in batch. It reads a list of login and password pairs from standard input or a file and uses
this information to update the passwords of this user accounts. The named account must exist and the password age will be updated. Each
input line is of the format:
user_name:password
If the hash algorithmus is not given on the commandline, the value of GROUP_CRYPT or, if not specified, CRYPT from /etc/default/passwd is
used as hash algorithmus. If not configured, the traditinal des algorithmus is used.
OPTIONS -c des|md5|blowfish
This option specifies the hash algorithmus, which should be used to encrypt the passwords.
-e The passwords are expected to be in encrypted form. Normally the passwords are expected to be cleartext.
-D, --binddn binddn
Use the Distinguished Name binddn to bind to the LDAP directory. The user will be prompted for a password for simple authentica-
tion.
-P, --path path
The passwd and shadow files are located below the specified directory path. chpasswd will use this files, not /etc/passwd and
/etc/shadow.
FILES
/etc/default/passwd - default values for password hash
SEE ALSO passwd(1), passwd(5), shadow(5)AUTHOR
Thorsten Kukuk <kukuk@suse.de>
pwdutils Feburary 2004 chpasswd(8)