Cygwin SSH问题,无法连接到本地主机,连接由127.0.0.1关闭

时间:2010-11-12 12:27:54

标签: ssh connection cygwin windows-server-2003

我在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

任何人都可以建议我需要做些什么才能让它发挥作用?

4 个答案:

答案 0 :(得分:0)

我对Cygwin了解不多,这个评论不属于评论(但我还没有足够的声誉),但......

我发现AndLinux比Cygwin更好/更容易使用。它感觉更像是一个真正的Linux与Windows共存,它使用Linux标准的包管理系统,这可能比安装Cygwin更容易安装额外的库或标题。

此外,另一条评论没有回答:您可以格式化您的问题,以便使用BlockQuote或代码示例格式化选项更容易阅读。

答案 1 :(得分:0)

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

答案 2 :(得分:0)

这看起来与我在这篇文章Public key authentication issues on cygwin上看到的问题相同。

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

# ssh -vv localhost

答案 3 :(得分:-1)

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

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

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