使用 Cygwin 在 Windows 上创建 SSHD 服务远程登录时失败

2014-09-06 00:35:25 +08:00
 Tonni
呃,在Youtube找了个视频,一步步在Windows机器上搭建了sshd服务,写了个文字教程: http://houcoder.github.io/2014/08/30/use-cygwin-install-sshd-on-windows/

搭建完成后在本机可以正常`ssh VBox@127.0.0.1`连接到本地,但是在局域网内的其他机器上执行命令`ssh VBox@192.168.1.124`就不能连接,下面是详细的ssh日志:

https://gist.github.com/HouCoder/0cc80b844f1c28e5c8b0

这个是怎么回事?
2835 次点击
所在节点    问与答
5 条回复
vibbow
2014-09-06 02:06:42 +08:00
直接用Bitvise SSH Server架设不好么?
freefcw
2014-09-06 07:34:29 +08:00
@vibbow 我记得这是收费的软件

楼主看一下防火墙之类的是不是把22给封了,或者你的sshd绑定的ip,sshd_config里面ListenAddress
Tonni
2014-09-06 09:54:24 +08:00
@vibbow 这个事收费的,而且不便宜
@freefcw Windows防火墙没有封锁22端口,ListenAddress应该也没有问题,我ssh连接时都执行到验证那一步了。
hellojinjie
2014-09-06 11:26:51 +08:00
你在本机的时候,不要用127.0.0.1
也用那个192的ip试试
Tonni
2014-09-06 19:05:28 +08:00
@hellojinjie 嗯,刚才测试了下,在搭建SSHD服务的Windows机器上不用127.0.0.1的方式连接本机是正常可以连接的,但是局域网的其它机器连接就失败,失败信息如下:

{ ~ } » ssh VBox@192.168.1.124 -v ~
OpenSSH_6.6.1, OpenSSL 1.0.1g 7 Apr 2014
debug1: Connecting to 192.168.1.124 [192.168.1.124] port 22.
debug1: Connection established.
debug1: identity file /home/Tonni/.ssh/id_rsa type 1
debug1: identity file /home/Tonni/.ssh/id_rsa-cert type -1
debug1: identity file /home/Tonni/.ssh/id_dsa type -1
debug1: identity file /home/Tonni/.ssh/id_dsa-cert type -1
debug1: identity file /home/Tonni/.ssh/id_ecdsa type -1
debug1: identity file /home/Tonni/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/Tonni/.ssh/id_ed25519 type -1
debug1: identity file /home/Tonni/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 1b:17:da:5c:48:45:5f:a0:cd:3b:c7:b4:9d:9c:6f:85
The authenticity of host '192.168.1.124 (192.168.1.124)' can't be established.
ECDSA key fingerprint is 1b:17:da:5c:48:45:5f:a0:cd:3b:c7:b4:9d:9c:6f:85.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.124' (ECDSA) to the list of known hosts.
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/Tonni/.ssh/id_rsa
Connection closed by 192.168.1.124

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/132015

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX