See libssh pack. It currently only does the server side though. The client side is most likely simpler to do. Maybe an exercise ? Seems you are looking for the client side? You can of course use library(process) and connect stdin and stdout from an ssh process.
I don’t think there is a ready to run pexpect alternative. Shouldn’t be very hard to write something like that in directly in Prolog and using DCGs it might even look pretty and be scalable.