<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 24.07.2016 16:33, Anthony Clark
wrote:<br>
</div>
<blockquote
cite="mid:CAJGYKdOEFHEu0AWmyOvqhSrFs41eF2qAr+abHqUdYMDNtrj+WQ@mail.gmail.com"
type="cite">
<div dir="ltr">Hello All,
<div><br>
</div>
<div>I have a crazy notion of storing a host's SSH private keys
in a ipa vault, so that a rebuilt host can use the same keys.</div>
<div><br>
</div>
<div>I'm on CentOS 7.2 and I'm using the RPMs available in the
standard centos base repository, so I'm constrained to version
1.0 vaults. I'm using this page: <a moz-do-not-send="true"
href="http://www.freeipa.org/page/V4/Password_Vault_1.0#Provisioning_service_vault_password_for_service_instance">http://www.freeipa.org/page/V4/Password_Vault_1.0#Provisioning_service_vault_password_for_service_instance</a></div>
<div><br>
</div>
<div>I'm trying these following steps but running into trouble:</div>
<div><br>
</div>
<div>ipa service-add ssh/<a moz-do-not-send="true"
href="http://test01.dev.redacted.net">test01.dev.redacted.net</a><br>
</div>
<div>
<div><br>
</div>
<div>certutil -N -d testcertdb</div>
<div><br>
</div>
<div>certutil -R -d testcertdb -a -g 2048 -s 'CN=<a
moz-do-not-send="true"
href="http://test01.dev.redacted.net">test01.dev.redacted.net</a>,O=<a
moz-do-not-send="true" href="http://DEV.REDACTED.NET">DEV.REDACTED.NET</a>'</div>
</div>
<div><paste that csr into the ipa web gui></div>
<div><br>
</div>
<div>ipa-getcert request -r -f testsshd01-cert.pem -k
testsshd01-key.pem -K ssh/<a moz-do-not-send="true"
href="mailto:test01.dev.redacted.net@DEV.REDACTED.NET">test01.dev.redacted.net@DEV.REDACTED.NET</a><br>
</div>
<div><br>
</div>
<div>ipa vault-add testsshd02 --service ssh/<a
moz-do-not-send="true"
href="mailto:test01.dev.redacted.net@DEV.REDACTED.NET"><a class="moz-txt-link-abbreviated" href="mailto:test01.dev.redacted.net@DEV.REDACTED.NET">test01.dev.redacted.net@DEV.REDACTED.NET</a></a>
--type asymmetric --public-key-file testsshd01-cert.pem<br>
</div>
<div><br>
</div>
<div>the last command gives me "ipa: ERROR: invalid
'ipavaultpublickey': Invalid or unsupported vault public key:
Could not unserialize key data."</div>
<div><br>
</div>
<div>Is there a preferred way to create a public key for
asymmetric encryption for a service vault?</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Anthony Clark</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
Hello,<br>
I suspect you should use just private key, not certificate<br>
<br>
<a class="moz-txt-link-freetext" href="https://en.wikibooks.org/wiki/Cryptography/Generate_a_keypair_using_OpenSSL">https://en.wikibooks.org/wiki/Cryptography/Generate_a_keypair_using_OpenSSL</a><br>
<br>
Regards,<br>
Martin<br>
</body>
</html>