我有PEM格式的私人DSA密钥。 接下来我要做什么来访问没有密码的SSH?
PEM格式的样品证书: http : //ospkibook.sourceforge.net/docs/OSPKI-2.4.7/OSPKI-html/sample-priv-key.htm
啊 – 我想你是混淆SSH证书和SSL证书。
ssh使用两种forms的双重身份validation密钥的两种forms:1)标准RSA或DSA密钥对(公共,私有)或2)ssh证书(根据man ssh-keygen )
…由一个公钥,一些身份信息,零个或多个主体(用户或主机)名称和一组可选的由authentication机构(CA)密钥签署的约束条件组成。
它继续说:
请注意,OpenSSH证书与ssl(8)中使用的X.509证书格式不同,也更简单。
要生成正常的ssh密钥对 ,请执行以下操作:
ssh-keygen -t rsa -b 2048 -f test
build议使用密码保护私钥。
然后,通过在目标主机用户的login主目录中的〜/ .ssh / authorized_keys文件中放置公钥( test.pub ),如果sshdconfiguration为“sshd”,则无需密码即可login到目标主机允许这个。
ssh -i test user@host
要生成一个ssh证书 ,请执行以下操作:
ssh-keygen -f ca_key #生成一个用作证书的ssh密钥对 ssh-keygen -s ca_key -I cert_identifier -h host_key.pub TrustedUserCAKeys /etc/ssh/ssh_cert/host_key.pub ssh-keygen -s ca_key -I cert_identifier user_key.pub 。 这应该生成user_key-cert.pub 假设这一切都正常进行, ssh -i user_key user@host将使用user_key-cert.pub文件,login将自动进行(如果在服务器上允许)。 如果已configuration,服务器将logging来自cert_identifier的连接。
SSH证书是一个新的function,仍然需要一些可用性方面动摇。 它们的好处包括中央签名密钥,通过authorized_keys约束连接的替代scheme以及限制ssh证书有效期限的可能性。
这可能会帮助你 – 链接
或者你也可以使用ssh-copy-id user@host 。