if you're trying to connect to an ssh server in an environment where the ssh2 extension cannot be installed this pure-php implementation may be helpful:
http://phpseclib.sourceforge.net/documentation/net.html