in reply to Change user to root using ssh::expect
I don't know why it isn't working.
I would not embed passwords in a script - particularly root passwords. Therefore I wouldn't try to solve the problem you are experiencing.
I would use public key authentication to enable automated access on a remote system, particularly in the case of root access. I might also use sudo to enable select commands for non-root users, rather than su to root.
|
|---|