blinksh / blink

Blink Mobile Shell for iOS (Mosh based)
https://blink.sh
GNU General Public License v3.0
6.18k stars 576 forks source link

Socket Error Unknown Error -1 #645

Closed ftoralesacosta closed 1 year ago

ftoralesacosta commented 5 years ago

When I try to ssh to a server, I get the following:

blink> ssh -vv pdsf ssh_connect: libssh 0.8.5 (c) 2003-2018 Aris Adamantiadis, Andreas Schneider and libssh contributors. Distributed under the LGPL, please refer to COPYING file for information about your rights, using threading threads_pthread ssh_connect: Socket connecting, now waiting for the callbacks to work ssh_socket_exception_callback: Socket exception callback: 2 (-1) ssh_socket_exception_callback: Socket error: Unknown error: -1

Socket error: Unknown error: -1

I can ssh from my laptop to this server no problem, and before the most recent update I could ssh to this server with blink with no problems. Anything I can do?

yury commented 5 years ago

Hi @ftoralesacosta,

Can you try ssh2 command instead? Also please provide more verbose output with ssh -vvvvvv pdsf.

ftoralesacosta commented 5 years ago

Wow, thanks for the quick response. ssh2 worked! Thanks a bunch

jamesmacwilliam commented 5 years ago

ssh2 did not work for me, this just randomly started happening (was working fine this morning, but not in the afternoon, no update occurred between when it was working and not). Is there any update on this?

yury commented 5 years ago

Hi @jamesmacwilliam, app restart help?

If so, it could leak somewhere... Need to investigate.

jamesmacwilliam commented 5 years ago

@yury I even uninstalled it. Not sure if this helps but here is my response from ssh2:

Could not connect to host: ssh: connect to host <my host> port 22: No route to host

jamesmacwilliam commented 5 years ago

ended up formatting the ipad and restoring, didn't work at first after formatting, and then almost as randomly as it stopped working, it started again šŸ¤·ā€ā™‚

mataneja commented 5 years ago

I am experiencing the same error. I was able to connect to the server just fine and randomly it started to throw the Socket error: Unknown error: -1.

@yury, in my case the output for ssh -vvv nuc is exactly the same as ssh -vvvvvv nuc and inline with what's mentioned above. That said, there is 1 additional line about:

ssh_connect: current state: 9

Anything else you recommend?

macwinnie commented 5 years ago

Hi,

Since the last iOS (12.3.1) Update, blink disallows me to connect to any of my servers:

blink> ssh -vvvvv host
ssh_connect: libssh 0.8.7 (c) 2003-2018 Aris Adamantiadis, Andreas Schneider and libssh contributors. Distributed under the LGPL, please refer to COPYING file for information about your rights, using threading threads_pthread
ssh_connect: Socket connecting, now waiting for the callbacks to work
ssh_socket_exception_callback: Socket exception callback: 2 (-1)
ssh_socket_exception_callback: Socket error: Unknown error: -1
ssh_connect: current state : 9

Socket error: Unknown error: -1

Another (single) server results in this logs ā€“ since the update:

blink> ssh -vvvvv host2
ssh_connect: libssh 0.8.7 (c) 2003-2018 Aris Adamantiadis, Andreas Schneider and libssh contributors. Distributed under the LGPL, please refer to COPYING file for information about your rights, using threading threads_pthread
ssh_connect: Socket connecting, now waiting for the callbacks to work
Connect timeout

I donā€˜t know, if these are the same issues as above ā€“ even if it results in the same error.

Thanks for your support! Cheers, Martin

Vincent-Carrier commented 5 years ago

Facing the same issue on iPadOS Beta. Very frustrating...

cyyyu commented 5 years ago

Ran into exact the same issue here using iOS12.3.1. Any idea?

glberen commented 5 years ago

Iā€™m also experiencing this on iOS 13 B7 as well. It was the same for B6.

thirdgen88 commented 5 years ago

Iā€™m also experiencing this error.. Oddly enough, if I ssh directly to the IP of the target host (which I have configured in the Blink hosts) it works okay. If I open nslookup in Blink and type the name of the target HostName, it resolves. But it doesnā€™t work just doing ssh <host>.

yury commented 5 years ago

@thirdgen88 thanks for info

thirdgen88 commented 5 years ago

@yury, You are welcome! One other thing I want to add in here is that Iā€™m having the same exact issue with Panicā€™s Prompt app.. I wonder if this is more system-related somehow?

yury commented 5 years ago

Iā€™m thinking that your host have ipv4 and ipv6. DNS resolves to v6 and it can be misconfigured. Can you check that?

thirdgen88 commented 5 years ago

@yury, I think youā€™ve nailed it. I had IPv6 enabled on my home router, to which I VPN in via OpenVPN hosted on a little Raspberry Pi. Iā€™ve got DNSMasq on there serving DNS to the network. Upon disabling IPv6, everything started to work normally. Iā€™ll have to look at getting DNSMasq to resolve local IPv6 I guess.. Thanks!

yury commented 5 years ago

Cool, glad we solved that. Anyway we need to add -4 and -6 options to ssh command.

aciolfi commented 4 years ago

I always receive the same error.

If I run: ssh -vvvvv host:

...
ssh_packet_need_rekey: packet: [data_rekey_needed=0, out_blocks=47, in_blocks=238
ssh_socket_exception_callback: Socket exception callback: 2 (-1) 
ssh_socket_exception_callback: Socket error: Unknown error: -1

V.13.5.7.244 on iOS v.14.0

Thank you

yury commented 3 years ago

We improved error handling in v13.5.10.

chrisdiana commented 3 years ago

FYI I was having similar issues with Socket Error: Unknown Error on iOS 14.4. After digging around I noticed in other apps that have SSH they ask for permission devices on the local network. Seems to be a relatively new security feature. I had to go into iOS Settings > Blink > Enable ā€œLocal Networkā€. After that I was able to SSH.

For some reason when I reinstalled Blink it didnā€™t ask for that permission so it kept erroring out.

carloscabanero commented 1 year ago

All these errors were fixed a long time ago when we rewrote all ssh stuff.