更多相关内容...>>Sierra系统Welly的SSH问题
Sierra系统Welly的SSH问题
by dp from 北大未名bbs
q96GJx http://blog.numino.net/
昨天下班前更新了 Sierra 系统,今天打开电脑,开 Welly,然后水木未名都上不去了。自己在命令行下尝试:
lwYd46 http://blog.numino.net/
$ ssh -1 newsmth.net
5VtRIH http://blog.numino.net/
ssh1 is not supported
l7ced3 http://blog.numino.net/
$ ssh 106.120.125.5
Iw7Qf7 http://blog.numino.net/
Unable to negotiate with 106.120.125.5 port 22: no matching key exchange
rIRxf9 http://blog.numino.net/
method found. Their offer: diffie-hellman-group1-sha1
EJT46w http://blog.numino.net/
呵呵,都是古老系统的问题
1P31L7 http://blog.numino.net/
未名的问题密钥交换算法太老,新版 ssh 默认关闭了,这个好解决,参考:
2FYaK3 http://blog.numino.net/
http://www.openssh.com/legacy.html
Hu8l5g http://blog.numino.net/
在 ~/.ssh/config,增加了一段
I3WiCG http://blog.numino.net/
Host 106.120.125.5
wpwU4s http://blog.numino.net/
KexAlgorithms +diffie-hellman-group1-sha1
Xr9T2K http://blog.numino.net/
就解决了
ixWWou http://blog.numino.net/
水木的问题坑爹,水木用的还是 ssh1 协议,新版的 openssh 在编译的时候默认就不带 ssh1 支持,那只好自己编译一个。
qjj20Q http://blog.numino.net/
我用 homebrew,直接
zoA1r2 http://blog.numino.net/
$ brew tap homebrew/dupes
ICHWY6 http://blog.numino.net/
$ brew install openssh --with-ssh1
r13xrT http://blog.numino.net/
还不行,--with-ssh1 这个参数不会传递给 ./configure,所以要先 brew edit openssh,增加几行:
dfM2v7 http://blog.numino.net/
class Openssh < Formula
3lz3xd http://blog.numino.net/
...
i3BIyI http://blog.numino.net/
+ option "with-ssh1", "Enable support for SSH protocol 1"
Zx4r1t http://blog.numino.net/
...
Cn214Q http://blog.numino.net/
def install
swJTF0 http://blog.numino.net/
...
6Cs2Px http://blog.numino.net/
+ if build.with? "ssh1"
6dseUV http://blog.numino.net/
+ args << "--with-ssh1"
4CQ3zF http://blog.numino.net/
+ end
AUo9Iw http://blog.numino.net/
...
nddvvW http://blog.numino.net/
end
22U7AK http://blog.numino.net/
end
2D3fwU http://blog.numino.net/
或者直接把 --with-ssh1 这个参数写到 args 那个列表里也行,重新编译,然后就获得了一个支持 ssh1 协议的 ssh 客户端。
Bl2Xe9 http://blog.numino.net/
装了 homebrew 里的 openssh 之后,你命令行的 ssh 就默认是 homebrew 的了,而 Welly 并不会调用这个 ssh ,看了源代码
zOqh71 http://blog.numino.net/
https://github.com/KOed/welly/blob/4c3631273fc820de0c2cf23ed0e42fbab86f93ca/WLPTY.m#L64
7GzTBk http://blog.numino.net/
发现,它是写死的调用 /usr/bin/ssh,这样一来我们就要改源代码重新编译了,对于我这种没用过 Xcode 的人想一想就觉得搞不定。。所以我想了个快捷的方案:
1gR0Tm http://blog.numino.net/
首先 ln -s `brew --prefix openssh`/bin/ssh /usr/local/s(可能需要sudo),注意此处这个 /usr/local/s 和之前的 /usr/bin/ssh 一样长,虽然我没试过不一样长会咋样,但是还是一样长保险一点。
F6xV7Y http://blog.numino.net/
然后把 /Applications/Welly.app/Contents/MacOS/Welly 里面的 /usr/bin/ssh 直接换成/usr/local/s
fWVG4U http://blog.numino.net/
$ LC_ALL=C sed -i.bak 's#/usr/bin/ssh#/usr/local/s#' /Applications/Welly.app/Contents/MacOS/Welly
8Rx6e7 http://blog.numino.net/
(不加LC_ALL=C的话会报错说sed: RE error: illegal byte sequence,不深究了)
e66LJE http://blog.numino.net/
至此,终于,Welly能用了。。。
更多相关内容...>>Sierra系统Welly的SSH问题

Bug报告 |  免责声明 |  联系我们 |  加入收藏

Copyright © 2006 NuminoStudio(www.numino.net) All Rights Reserved