You understand me wrong. My solution works fine for your question.
You don't have to relogin for every command.
Open the session, login and run your commands.
But if your commands need the same shell context you have to combine them in one command or use a ShellStream.
If you want to talk to a database, why do you need the same shell for the commands?
Why not forward your database with port forwarding and talk to the database directly
instead of invoking shell commands?
You don't have to relogin for every command.
Open the session, login and run your commands.
But if your commands need the same shell context you have to combine them in one command or use a ShellStream.
If you want to talk to a database, why do you need the same shell for the commands?
Why not forward your database with port forwarding and talk to the database directly
instead of invoking shell commands?