I want to login to remote server and run multiple commands on the same and exit. As on the remote server I am not having root access, so I am unable to use sshpass. Hence I was trying to use expect command/script as follow:
#!/usr/bin/expect -fset timeout -1spawn ssh username@ip_address /bin/bash << "EOF"expect "username@ip_address's password:"send "password\r"interactlspwdcd#multiple commandsEOF
In above code I was able to login to my remote sever, however I am not able to use EOF / multiple commands.Help will be appreciated.