V
V
Vladimir Merk2015-09-21 19:55:09
PHP
Vladimir Merk, 2015-09-21 19:55:09

Why doesn't a socket open on a non-standard ssh port, although the port is working?

Hello.
When trying to open from php ssh on a non-standard port,

$fp = fsockopen("10.20.30.40", 1234, $errno, $errstr, 30);


the error Error 110 falls out all the time. Connection timed out.
If the port is standard - everything works, if not, a timeout occurs. At the same time, putty, winscp and other programs connect without problems.
What can be wrong?

UPD:
In the logs, on the machine to which I am trying to connect, I see the following picture:
Sep 21 19:35:25 sshd[21458]: reverse mapping checking getaddrinfo for ip.178-70-22-20.avangarddsl.ru [11.22.33.44] failed - POSSIBLE BREAK-IN ATTEMPT!
Sep 21 19:35:25 sshd[21458]: Accepted password for root from 11.22.33.44 port 14474 ssh2
Sep 21 19:35:25 sshd[21458]: pam_unix(sshd:session): session opened for user root by (uid=0)
Sep 21 19:35:25 sshd[21458]: subsystem request for sftp by user root
Sep 21 19:35:49 sshd[21336]: Received signal 15; terminating.
Sep 21 19:35:49 sshd[21476]: Server listening on 0.0.0.0 port 1234.
Sep 21 19:35:49 sshd[21476]: Server listening on :: port 1234.


11.22.33.44 is the machine I'm trying to connect to, 1234 is the current ssh port

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question