我一直在研究一个打算用来创build自己的PKI的openSSL.cnf文件。 我还没有完成那个文件的工作,但是我还得做其他的事情。 所以我把它写入磁盘未完成,分离我的屏幕会话,并注销。 从那以后,我无法使用带有私钥的SSH(这是访问机器的唯一方式)login到计算机。
如果我运行ssh -vvv example.com ,我得到以下内容
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007 debug2: ssh_connect: needpriv 0 debug1: Connecting to example.com [1.2.3.4] port 22. debug1: Connection established. debug1: identity file /c/Users/user/.ssh/identity type -1 debug3: Not a RSA1 key file /c/Users/user/.ssh/id_rsa. debug2: key_type_from_name: unknown key type '-----BEGIN' debug3: key_read: missing keytype debug2: key_type_from_name: unknown key type 'Proc-Type:' debug3: key_read: missing keytype debug2: key_type_from_name: unknown key type 'DEK-Info:' debug3: key_read: missing keytype debug3: key_read: missing whitespace ^^^ this line 24 more times ^^^ debug2: key_type_from_name: unknown key type '-----END' debug3: key_read: missing keytype debug1: identity file /c/Users/user/.ssh/id_rsa type -1 debug1: identity file /c/Users/user/.ssh/id_dsa type -1 ssh_exchange_identification: Connection closed by remote host
它看起来像ssh抱怨我~/.ssh/id_rsa的格式。 但是,相同的密钥仍适用于不同的服务器。 无论如何,这是我的身份证件的样子:
-----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,... ... -----END RSA PRIVATE KEY-----
在客户端,我使用了GitBash附带的ssh实现,因为这给了我最详细的输出。 (腻子在debugging部门不那么健谈)。
我搞砸了服务器上的sshdconfiguration吗? 我可以以某种方式仍然强制我的方式使用SSH和适当的身份文件? 服务器运行debian 6
一旦我再次访问服务器,我自己想出了答案。
答案是肯定的。 把我的不完整编辑的/etc/ssl/openssl.conf移到/root/messed-up.openssl.cnf ,为我解决了这个问题。