Chris Corbyn wrote:I'm not familiar with those functions, but speaking generally from an SSH point of view, perhaps the other server uses a type of key or authentication which those functions do not support? For example, maybe those function rely on password logins being enabled in sshd_config? Do you know anything about the configurations of the two servers?
Could password logins sshd_config still be disabled, considering I can log in via sftp on the command line? I noticed from the get go that I was unable to log into the second server via 'ssh user@host -p 3222'--but like I said, I can log in via sftp.
Chris Corbyn wrote:
EDIT | I assume your running this code *from* the same server? The other possibility is that your web host have certain ports firewalled off.
Nope, the code is being run from a different server--my personal server--and I have no firewall such outgoing firewall restrictions in place. The server I am trying to connect to has port 3222 open.
One additional interesting thing I forgot to add is that I CAN upload files to the server like this:
Code: Select all
$fp = fopen("ssh2.sftp://$sftp/directory/bug.gif", "wb");
fwrite($fp, $buffer, strlen($buffer));
fclose($fp);
I can also download files (although, when I try, the program gets stuck in an infinite loop: while (!feof($fp)) { ... } -- apparently it cannot tell whether eof has been reached on the stream).