I currently have a bash script that uses the wait in it, performing some actions on ssh. It looks like this:
#!/bin/bash #some bash stuff here ... /usr/bin/expect -c ' spawn somescript.sh expect "password:" send "$PASSWD" ' ...
somescript.sh executes commands to the remote server on top of ssh, but now my login requires changing the password. I tried
/usr/bin/expect -c ' spawn somescript.sh expect "password:" send "$PASSWD" expect "current password" send "$PASSWD" expect "new password" send "$NEWPASSWD" '
but I get an error:
WARNING: Your password has expired.\n Password change required but no TTY available.
source share