spatie / ray

Debug with Ray to fix problems faster
https://myray.app
MIT License
578 stars 103 forks source link

Can't connect to remote server which is configured by laravel forge #405

Closed zgabievi closed 3 years ago

zgabievi commented 3 years ago

Describe the bug Can't connect to remote server over ssh, which is using laravel forge. I've private key connection to the server. I can connect to server using terminal but not with Ray app.

Versions Ray version: 1.14.7

You can use composer show to get the version numbers of:

PHP version: 7.4.16 Laravel version: 8.35.1

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Servers'
  2. Add server using ip address, ssh key path and forge user
  3. Try to connect
  4. See error

Expected behavior It should connect to server.

Screenshots image

Desktop (please complete the following information):

jkbennemann commented 3 years ago

I do have almost the same issue, but not specifically with forge.

Describe the bug For some reason I am not able to connect to a remote server. On connection ray responds with information: "Ray was unable to bind to the remote server's port. Is the port in use or is someone else using ray on this server?"

The direct connection through iTerm does work for both servers though.

Versions Ray version: 1.14.7

Composer: not installed

PHP version: 7.4.16

To Reproduce Steps to reproduce the behavior: reproducable with my private ssh key only. See additional context below.

Expected behavior It would expect that ray is able to connect to the server ssh.dsdae.com via port 22 and my ssh key as they are same for both servers.

Screenshots First server works seamlessly:

Bildschirmfoto 2021-04-13 um 10 14 57

Error on connecting to ssh.dsdae.com

Bildschirmfoto 2021-04-13 um 10 06 01

Desktop (please complete the following information):

The "working" server does have simple iptables firewall settings in place which only allow connection through port 22, 80, 443, established once and local interface. Everything else is dropped.

The "non-working" server does have almost the same iptables firewall settings in place which only allow connection through port 22, 80, 443, established once and local interface and some very specific ones for smtp config. I even switched off the entire firewall temporarily but this does not work neither.

Because of this I don't think the firewall is


Working connection through iTerm via ssh for server which ray is able to connect to.
{10:03}~ ➭ ssh jakob@lbXXXXXXXXXXXXXXn.de ##working
{10:03}~ ➭ ssh -i ~/.ssh/id_rsa -p 22 jakob@lbXXXXXXXXXXXXXXn.de ##working
Welcome to Ubuntu
Last login: Tue Apr 13 10:03:59 2021 from XXXXXXXXXXXXXXX
jakob@lb-01:~$

##Working connection through iTerm via ssh for server which ray is not able to connect to.
{10:01}~ ➭ ssh wp@ssh.dsdae.com  ##working
{10:01}~ ➭ ssh -i ~/.ssh/id_rsa -p 22 wp@ssh.dsdae.com ##working
Last login: Tue Apr 13 10:01:42 2021 from XXXXXXXXXXXXXXX
[21-04-13 10:06]wp@ssh.dsdae.com:~%