I am trying to build and expect script to log into multiple aix boxes and change password.
Shell Scipt: temp.sh
<code>
su - <$username>
expect pass.exp
<code>
Expect script: pass.exp
#!/usr/bin/expect -f
# Login
#######################
expect "Password: " send "<$password>\r"
it comes up with Password: but doesnt take password passed throguh file.
Hi
I'm trying to run a script " abc.sh" which triggers "use.sh" .
abc.sh is nothing but a "expect" script which provides username and password automatically to the use.sh script.
Please find below the scripts:
#abc.sh
Code:
#!/usr/bin/expect -f
exec /root/use.sh
expect "*name*"
send "baddy\r"
expect "*word*"
send "compaq\r&qu
Hi,
I am in learning curve in the Tcl/expert language.
I created a script wherein it will change password of a user
Quote:
#!/usr/bin/expect
spawn passwd [lindex $argv 0]
set password [lindex $argv 1]
expect "New UNIX password:"
send "$password\r"
expect "Retype new UNIX password:"
send "$password\r"
Hi.
Here is beginning of my script
Code:
#!/usr/local/bin/expect --
set timeout 15
spawn /usr/local/account.sh -n modify
expect "Password:" {send "mypassword\r"}
But due to some terminal control sequences (or something else, dunno exactly) my password prompt is looking like this:
Code:
[[61;157R-n Password:
and expect doesn't recognize it.
I just installed 11.3 on a little laptop and I can't get tcsh to load my .login file.
I set the machine to come up in "runlevel 3" -- Multi-User mode, console logins only
I changed my shell to /bin/csh:
Code:
% chsh -s /bin/csh
Password:
Shell changed
(/bin/csh is a link to tcsh)
I added some lines to ~/.login:
I need to automate ssh using expect. The login can be with the host ip address or with localhost.
How will the expect cmd look like if I have to match either:
expect "root@localhost's password:"
or
expect "root@$ip's password:"
Thanks,
Dhanesh.
I have always used the traditional log-in methods to prevent my kids etc. from having administrative privileges. Now, with the kids grown up, I wanted to set-up my Ubuntu 12.04 log me in without a password.