Building interactive SSH applications
Writing interactive SSH applications is actually pretty easy, but it does require some knowledge of the pieces involved and a little bit of general Unix literacy.
Source: Building interactive SSH applications, a post on Drew DeVault's blog.