I\'ve searched around a bit for similar questions, but other than running one command or perhaps a few command with items such as:
ssh user@host -t sudo su -
Often, I'll just use the original Tcl version of Expect. You only need to have that on the local machine. If I'm inside a program using Perl, I do this with Net::SSH::Expect. Other languages have similar "expect" tools.