PHP ssh2_connect issue

Error starting up SSH connection(-3): Error sending banner

Page 1 of 1

4 Replies - 10142 Views - Last Post: 01 July 2010 - 04:32 AM Rate Topic: -----

#1 MBraybrook  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 37
  • Joined: 14-August 06

PHP ssh2_connect issue

Posted 28 June 2010 - 04:09 AM

Hi D.i.C

I've got this problem with using the ssh2_connect function within PHP, I'm using the following code:

$this->_conn_id = ssh2_connect($this->_ftp['url'], 22);


And getting the following response:
Warning: ssh2_connect() [function.ssh2-connect]: Error starting up SSH connection(-3): Error sending banner to remote host


The script then fails to make any SSH connection.

I know the SSH libraries are setup correctly, but I'm not sure whether this could be a firewall issue, or a code issue.

Has anybody seen this error, or a similar one before and is therefore able to shed any light?

M

Oh, and $this->_ftp['url'] is a bit of a misnomer, as it's neither for FTP here nor is it a URL it is an IP address.

I can't disclose the IP address itself, but it's just as you would expect it to be.

M

Is This A Good Question/Topic? 0
  • +

Replies To: PHP ssh2_connect issue

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6246
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: PHP ssh2_connect issue

Posted 28 June 2010 - 05:15 AM

Can you connect through SSH from the command line? That's the first thing I would check. This error would seem to indicate that SSH on the server is not responding to your request.
Was This Post Helpful? 4
  • +
  • -

#3 MBraybrook  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 37
  • Joined: 14-August 06

Re: PHP ssh2_connect issue

Posted 28 June 2010 - 05:54 AM

That's a good suggestion, and no, I hadn't until now and it cannot connect. I'll go back to the drawing board and post my results further down the line.

M
Was This Post Helpful? 0
  • +
  • -

#4 MBraybrook  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 37
  • Joined: 14-August 06

Re: PHP ssh2_connect issue

Posted 01 July 2010 - 04:07 AM

Yep, sorry guys, rookie mistake.

Firewall was not configured to allow the communication, I fear this post probably won't help anyone...! :(

Regards
M
Was This Post Helpful? 0
  • +
  • -

#5 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6246
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: PHP ssh2_connect issue

Posted 01 July 2010 - 04:32 AM

Damn firewalls...glad you got it sorted!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1