在安装 Hadoop 期间,我尝试设置 CYGWIN 和ssh
。已安装,ssh 也已成功启动,并按照说明设置授权密钥这里但是当我尝试使用ssh
它连接到本地主机时显示..
$ ssh -v localhost
OpenSSH_6.2p1, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file /home/manu/.ssh/id_rsa type 1
debug1: identity file /home/manu/.ssh/id_rsa-cert type -1
debug1: identity file /home/manu/.ssh/id_dsa type -1
debug1: identity file /home/manu/.ssh/id_dsa-cert type -1
debug1: identity file /home/manu/.ssh/id_ecdsa type -1
debug1: identity file /home/manu/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
debug1: match: OpenSSH_6.2 pat OpenSSH*
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 ec:bb:51:bb:d4:74:8f:27:49:8c:ef:59:a6:2b:ab:59
debug1: Host 'localhost' is known and matches the ECDSA host key.
debug1: Found key in /home/manu/.ssh/known_hosts:1
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/manu/.ssh/id_rsa
Connection closed by ::1
经过很多谷歌搜索我试过了ssh -v cyg_server@localhost
但它提示输入我不知道的密码。
$ ssh -v cyg_Server@localhost
OpenSSH_6.2p1, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file /home/manu/.ssh/id_rsa type 1
debug1: identity file /home/manu/.ssh/id_rsa-cert type -1
debug1: identity file /home/manu/.ssh/id_dsa type -1
debug1: identity file /home/manu/.ssh/id_dsa-cert type -1
debug1: identity file /home/manu/.ssh/id_ecdsa type -1
debug1: identity file /home/manu/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
debug1: match: OpenSSH_6.2 pat OpenSSH*
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 ec:bb:51:bb:d4:74:8f:27:49:8c:ef:59:a6:2b:ab:59
debug1: Host 'localhost' is known and matches the ECDSA host key.
debug1: Found key in /home/manu/.ssh/known_hosts:1
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/manu/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/manu/.ssh/id_dsa
debug1: Trying private key: /home/manu/.ssh/id_ecdsa
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
cyg_Server@localhost's password:
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
cyg_Server@localhost's password:
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
cyg_Server@localhost's password:
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: No more authentication methods to try.
Permission denied (publickey,password,keyboard-interactive).
有人能帮我与 localhost 建立成功且经过身份验证的 ssh 连接吗?无论是通过密码,还是创建另一个用户,或者跳过身份验证步骤。这对我来说太好了!谢谢。
答案1
以下是一些可以尝试的方法:
- 尝试替换
127.0.0.1
localhost。 - 验证 cyg_server 用户帐户是否具有有效的主目录(
/home/cyg_server
如果需要,请创建)并且其 shell 是/bin/bash
。 - 彻底卸载 Cygwin,清理其目录和环境变量,然后重新安装。要使用的密码是您在配置 Cygwin 时提供的密码。
- 尝试使用您的普通帐户,而不是 Cygwin 安装建议的 cyg_server。
我不明白为什么您在使用 Cygwin 时您的帖子被标记为“linux”——在这种情况下应该是“windows”。在这种情况下,请查看这篇文章: 在 Windows 中运行 Hadoop。
答案2
cyg_server
不供用户直接使用。
检查/etc/hosts
文件是否正确,检查它是否明确将 localhost 解析为 127.0.0.1。
如果您不需要 IPv6,请将其停用。