使用usbmuxd 连接SSH 报错ssh_exchange_identification: Connection closed by remote host连接不上


#1

使用usbsbmuxd连接SSH

终端输入:
AlandeiMac:USBSSH Alanpython tcprelay.py 22:2222 Forwarding local port 2222 to remote port 22 Incoming connection to 2222 Waiting for devices... Connecting to device <MuxDevice: ID 1 ProdID 0x12a8 Serial '57fe8578a65bc8faee5babd864b0bd3c2505aead' Location 0x14200000> Connection established, relaying data Connection closed
新建终端输入报错:
AlandeiMac:~ Alan$ ssh root@localhost -p 2222 ssh_exchange_identification: Connection closed by remote host AlandeiMac:~ Alan$

操作步骤好像没问题 之前10.2版本是可以的 现在用的是iOS9.2


#2

装openssh了?


#3

装了


#4

手机电脑都重启试试吧


#5

没用 还是这样。


#6

刪除~/.ssh/known_hosts試試


#7

还是不行。
AlandeiMac:~ Alan$ rm ~/.ssh/known_hosts AlandeiMac:~ Alan$ cd ~/.ssh/ AlandeiMac:.ssh Alan$ ls github_rsa github_rsa.pub known_hosts.old AlandeiMac:.ssh Alan$ AlandeiMac:.ssh Alan$ cd /Users/Alan/Downloads/USBSSH AlandeiMac:USBSSH Alan$ python tcprelay.py 22:2222 Forwarding local port 2222 to remote port 22 Incoming connection to 2222 Waiting for devices... Connecting to device <MuxDevice: ID 22 ProdID 0x12a8 Serial '57fe8578a65bc8faee5babd864b0bd3c2505aead' Location 0x14200000> Connection established, relaying data Connection closed


#8

试试usbmuxd最新版本的


#9

我用的1.0.8


#10

最新版本也不可以 报错

AlandeiMac:local Alan$ iproxy 2222 22
waiting for connection
accepted connection, fd = 4
waiting for connection
Number of available devices == 5
Requesting connecion to device handle == 294 (serial: 77da62280e5b621298b8285f7d35ad1ff0d6675d), port 22
Error connecting to device!

#11

把xcode clean 一遍,然后xcode->preferences->locations->deriveData 清除一遍就OK了


#12

好像没啥用,不过数字变了

AlandeiMac:local Alan$ iproxy 2222 22
waiting for connection
accepted connection, fd = 4
waiting for connection
Number of available devices == 3
Requesting connecion to device handle == 17 (serial: c5193125a559538b639e13a008fa422f8e59627e), port 22
Error connecting to device!

#13
AlandeiMac:.ssh Alan$ ssh -vvv root@127.0.0.1 -p 2222
OpenSSH_7.4p1, LibreSSL 2.5.0
debug2: resolving "127.0.0.1" port 2222
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 2222.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Alan/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Alan/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Alan/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Alan/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Alan/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Alan/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Alan/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/Alan/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
ssh_exchange_identification: Connection closed by remote host

具体错误日志。求助困扰好久了 百度 google 都找了。


#14

已解决:一直以为是电脑的问题 ,最后发现是手机问题 连接SSH 查看系统日志 usr/lib缺少libcrypto.0.9.8.dylib 文件 重新安装OPENSSL解决


#15

大哥,貌似我也跟你一样的情况,按你说的重装openssl 无法解决,如何查看系统日志呢?