I have done exactly this. You need:
1. The Java Terminal Adapter (JTA), which I think now lives in SourceForge somewhere. You will find it.
2. The Ganymed SSH-2 package.
3. A simple adapter class between the two which I will post here when you need it.
You need to study (1) rather carefully to see how to deploy it, and how to add a user-defined plugin. When you've mastered that, I will post the plugin that joins (1) and (2) together.
I know that if i wanted just to place a line i could use "commandsJS=inFromUser.readLine();"
What can i use now? Do you have you know any command that it could help me?