【问题标题】:Cygwin SSH problem, unable to connect to local host, connection closed by 127.0.0.1Cygwin SSH 问题,无法连接到本地主机,连接被 127.0.0.1 关闭
【发布时间】:2011-05-09 01:17:12
【问题描述】:

我在 windows 2003 服务器上安装了 cygwin,我添加了 openssh 包,设置了必要的环境变量, 运行以下命令

mkpasswd -l > /etc/passwd
mkgroup  -l > /etc/group
ssh-host-config
ssh-user-config

我已经启动了 SSH 服务,但是当我运行 ssh -v localhost 时,我得到以下信息

debug1: Reading configuration data /etc/ssh_config
debug1: Connection to localhost [127.0.0.1] port 22.
debug1: Connection established.
debug1: identity file /home/RLawton_P/.ssh/id_rsa type 1
debug1: identity file /home/RLawton_P/.ssh/id_rsa-cert type -1 
debug1: identity file /home/RLawton_P/.ssh/id_dsa type 2
debug1: identity file /home/RLawton_P/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.6
debug1: match: OpenSSH_5.6 pat OpenSSH*
debug1: Enabling compatability mode for protocol 2.0
debug1: Local version string SSh-2.0-OpenSSH_5.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024(1024(8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'localhost' is known and matches the RSA host key.
debug1: Found key in /home/Rlawton_P/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowede by server
debug1: SSH2_MSG_SERVICE_REQUEST
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/RLawton_P/.ssh/id_rsa
Connection closed by 127.0.0.1

谁能告诉我需要做什么才能让它工作?

【问题讨论】:

  • 在 SuperUser/ServerFault 上可能更合适...

标签: ssh connection cygwin windows-server-2003


【解决方案1】:

当您安装 Cygwin 并运行 ssh-host-config 时,您可能创建了名为“cyg_server”的用户。因此,当您连接到 ssh 时,您需要使用该用户“cyg_server@localhost”。

当您使用该用户运行 ssh 时,它会询问您在运行 ssh-host-config 时提供的密码。

$ ssh cyg_server@localhost
cyg_server@localhost 的密码:
上次登录时间:2012 年 12 月 31 日星期一 01:14:44 来自 ::1
cyg_server@polorumpus ~
$
希望对你有用。

【讨论】:

    【解决方案2】:

    如果您确实需要提升权限,请使用具有管理权限 (XP) 的帐户启动 cygwin shell,或 r-单击 cygwin.bat 并“以管理员身份运行”(Vista、Win7)。这应该可以解决这个问题。

    【讨论】:

      【解决方案3】:

      这看起来与我在这篇帖子中看到的相同问题,Public key authentication issues on cygwin

      您可以在连接时进入下一个详细级别进行验证,

      # ssh -vv localhost
      

      【讨论】:

        猜你喜欢
        • 2014-01-16
        • 2013-01-25
        • 1970-01-01
        • 2016-12-22
        • 2013-08-07
        • 2014-05-21
        • 2019-10-27
        • 2017-12-01
        • 1970-01-01
        相关资源
        最近更新 更多