Question:
I have another question: I can establish SSH connection and issue commands and all, but it seems to disconnect very soon if there is no operation going on. How can I keep the connection on while other operations are taking place?
You might try periodically calling the SendIgnore method to keep the connection from being idle.