2017-07-06 113 views
1

如您所见,它陷入困境。 以下是详细连接显示的内容。 将ssh添加到cygwin服务器

[[email protected] ~]$ ssh -v [email protected] 
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: Applying options for * 
debug1: Connecting to uscasaciccx82 [113.130.154.54] port 22. 
debug1: Connection established. 
debug1: identity file /cpmapps/ftpuser/.ssh/identity type -1 
debug1: identity file /cpmapps/ftpuser/.ssh/id_rsa type 1 
debug1: identity file /cpmapps/ftpuser/.ssh/id_dsa type -1 
debug1: loaded 3 keys 
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1 
debug1: match: OpenSSH_6.6.1 pat OpenSSH* 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_4.3 
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 'uscasaciccx82' is known and matches the RSA host key. 
debug1: Found key in /cpmapps/ftpuser/.ssh/known_hosts:7 
debug1: ssh_rsa_verify: signature correct 
debug1: SSH2_MSG_NEWKEYS sent 
debug1: expecting SSH2_MSG_NEWKEYS 
debug1: SSH2_MSG_NEWKEYS received 
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: /cpmapps/ftpuser/.ssh/identity 
debug1: Offering public key: /cpmapps/ftpuser/.ssh/id_rsa 
debug1: Server accepts key: pkalg ssh-rsa blen 277 
debug1: read PEM private key done: type RSA 
debug1: Authentication succeeded (publickey). 
debug1: channel 0: new [client-session] 
debug1: Entering interactive session. 
debug1: Sending environment. 
debug1: Sending env LANG = en_US.UTF-8 

我试图连接到服务器没有密钥,但它仍然无法正常工作。 [[email protected] ~]$ ssh -o PreferredAuthentications=keyboard-interactive,password -o PubkeyAuthentication=no [email protected] [email protected]'s password:

我可以在本地服务器上正常登录到cygwin。

local server

+0

当你说它卡住了,你究竟是什么意思? – McGlothlin

+0

它从不显示它说它连接到远程服务器的屏幕。 – user2373210

+0

你确定ssh服务器正在运行吗? – McGlothlin

回答

0

既然你试图连接到Windows机器上,你可能没有安装/ SSH服务器启用。检查以确保在cygwin环境中安装并正确配置了SSH。它是OpenSSH软件包的一部分。更多信息here

编辑:See this post哪里有人有完全相同的错误。

+0

SSH服务器安装正常,因为2天前它工作正常。我检查了日志,这是它显示的内容。我没有在日志中看到时间戳,但日志文件的时间戳是从他们重新启动cygwin的时间开始的。 无法加载主机密钥:在/ etc/ssh_host_ed25519_key 无法加载主机密钥:在/ etc/ssh_host_ed25519_key 无法加载主机密钥:在/ etc/ssh_host_ed25519_key 无法加载主机密钥:在/ etc/ssh_host_ed25519_key 无法加载主机密钥:/ etc/ssh_host_ed25519_key 无法加载主机密钥:/ etc/ssh_host_ed25519_key – user2373210

0

这是什么修复了我的问题。

Run sshd in debug mode using below command 

/usr/sbin/sshd.exe -D -dd 

这给了我下面的警告

$ /usr/sbin/sshd.exe -D -dd DEBUG2:load_server_config:文件名 的/ etc/sshd_config中DEBUG2:load_server_config:完成配置LEN = 285 debug2:parse_server_config:config/etc/sshd_config len 285 debug1: sshd version OpenSSH_7.5,OpenSSL 1.0.2k 2017年1月26日 @@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
警告:无保护的私钥文件! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@ '/ etc/ssh_host_rsa_key'的权限0770太开放了。它是 要求您的私钥文件不能被其他人访问。 该私钥将被忽略。 key_load_private:错误的权限 无法加载主机密钥:/ etc/ssh_host_rsa_key @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
警告:无保护的私钥文件! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@ '/ etc/ssh_host_dsa_key'的权限0770太开放了。它是 要求您的私钥文件不能被其他人访问。 该私钥将被忽略。 key_load_private:错误的权限 无法加载主机密钥:/ etc/ssh_host_dsa_key @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
警告:无保护的私钥文件! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@ '/ etc/ssh_host_ecdsa_key'的权限0770太开放了。它是 要求您的私钥文件不能被其他人访问。 该私钥将被忽略。 key_load_private:错误的权限 无法加载主机密钥:/ etc/ssh_host_ecdsa_key @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
警告:无保护的私钥文件! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@ '/ etc/ssh_host_ed25519_key'的权限0770太开放了。它是 要求您的私钥文件不能被其他人访问。 该私钥将被忽略。key_load_private:错误的权限 无法加载主机密钥:/ etc/ssh_host_ed25519_key sshd:没有主机密钥 可用 - 退出。

So I changed the permissions of the above files to 600 

$ chmod 0600 /etc/ssh_host* 

Then the debug command again. 

SHA256:4yqAb/GiMfMJPmIXfKz+Zw4fWOCVN7E6vUDHEtokdHk /var/empty must be owned by root and not group or world-writable. 

那么这个文件夹的权限更改为600

$搭配chmod 600的/ var /空

这个固定的问题。