我正在尝试在 Cygwin 上设置 ssh 和 ssh 到 localhost,但出现以下错误。任何建议都将不胜感激:
$ ssh -v localhost
OpenSSH_6.0p1, OpenSSL 1.0.1c 10 May 2012
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file /home/fx86/.ssh/id_rsa type -1
debug1: identity file /home/fx86/.ssh/id_rsa-cert type -1
debug1: identity file /home/fx86/.ssh/id_dsa type -1
debug1: identity file /home/fx86/.ssh/id_dsa-cert type -1
debug1: identity file /home/fx86/.ssh/id_ecdsa type -1
debug1: identity file /home/fx86/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0
debug1: match: OpenSSH_6.0 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.0
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: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 83:47:37:29:aa:9b:f4:38:2c:e3:97:b6:af:96:46:ae
debug1: Host 'localhost' is known and matches the ECDSA host key.
debug1: Found key in /home/fx86/.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: Trying private key: /home/fx86/.ssh/id_rsa
debug1: Trying private key: /home/fx86/.ssh/id_dsa
debug1: Trying private key: /home/fx86/.ssh/id_ecdsa
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
fx86@localhost's password:
debug1: Authentication succeeded (password).
Authenticated to localhost ([::1]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: channel 0: free: client-session, nchannels 1
Connection to localhost closed by remote host.
Connection to localhost closed.
Transferred: sent 2136, received 1504 bytes, in 0.0 seconds
Bytes per second: sent 71143.0, received 50093.2
debug1: Exit status -1
执行 /usr/sbin/sshd.exe -d 并得到:
debug1: sshd version OpenSSH_6.0p1
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #1 type 2 DSA
debug1: read PEM private key done: type ECDSA
debug1: private host key: #2 type 3 ECDSA
/var/empty must be owned by root and not group or world-writable.
答案1
/var/empty 上的权限不正确。
尝试这个:
chown root:root /var/empty
chmod 755 /var/empty
chmod 711 /var/empty/sshd