V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
Tonni
V2EX  ›  问与答

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

  •  
  •   Tonni · 2014-09-06 00:35:25 +08:00 · 2830 次点击
    这是一个创建于 3550 天前的主题,其中的信息可能已经有所发展或是发生改变。
    呃,在Youtube找了个视频,一步步在Windows机器上搭建了sshd服务,写了个文字教程: http://houcoder.github.io/2014/08/30/use-cygwin-install-sshd-on-windows/

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

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

    这个是怎么回事?
    5 条回复    2014-09-06 19:05:28 +08:00
    vibbow
        1
    vibbow  
       2014-09-06 02:06:42 +08:00
    直接用Bitvise SSH Server架设不好么?
    freefcw
        2
    freefcw  
       2014-09-06 07:34:29 +08:00
    @vibbow 我记得这是收费的软件

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

    { ~ } » ssh [email protected] -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 [email protected] none
    debug1: kex: client->server aes128-ctr [email protected] 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
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   887 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:38 · PVG 05:38 · LAX 14:38 · JFK 17:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.