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

发布于 2024-10-02 01:08:19 字数 1846 浏览 4 评论 0原文

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

任何人都可以建议我需要做什么才能使其正常工作吗?

I have installed cygwin on a windows 2003 server, I added the openssh package, set up the neccesary enviroment variables,
run the following commands

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

I've started the SSH service but when i run ssh -v localhost i get the following

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

can anyone advise what i need to do to get it working?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

独享拥抱 2024-10-09 01:08:19

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

If you really need elevated privileges start cygwin shell with from an account with administrative privileges (XP) or r-click on cygwin.bat and "run as administrator" (Vista,Win7). That should olve this issue.

相思碎 2024-10-09 01:08:19

这看起来与我在这篇文章中看到的问题相同,公钥身份验证问题在 cygwin 上。

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

# ssh -vv localhost

This looks like the same issue I saw on this post, Public key authentication issues on cygwin.

You can verify by going into the next verbosity level when connecting,

# ssh -vv localhost
污味仙女 2024-10-09 01:08:19

当您安装 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 ~
$
我希望它会有用。

When you installed Cygwin and ran ssh-host-config, you might have created user called "cyg_server". So when you are connecting to ssh, you need to use that user "cyg_server@localhost".

When you run ssh with that user, it will ask you for the password that you provided when you ran ssh-host-config.

$ ssh cyg_server@localhost
cyg_server@localhost's password:
Last login: Mon Dec 31 01:14:44 2012 from ::1
cyg_server@polorumpus ~
$
I hope it will be useful.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文