{"id":443,"date":"2013-11-10T23:25:06","date_gmt":"2013-11-11T07:25:06","guid":{"rendered":"http:\/\/porkrind.org\/missives\/?p=443"},"modified":"2013-11-10T23:36:08","modified_gmt":"2013-11-11T07:36:08","slug":"mac-os-x-10-9-mavericks-and-ssh-pkcs8-keys","status":"publish","type":"post","link":"https:\/\/porkrind.org\/missives\/mac-os-x-10-9-mavericks-and-ssh-pkcs8-keys\/","title":{"rendered":"Mac OS X 10.9 (Mavericks) and SSH pkcs8 keys"},"content":{"rendered":"<p>After upgrading to Mavericks (Mac OS X 10.9) I found that <tt>ssh-add<\/tt> wasn&#8217;t working. After investigating I discovered that the SSH shipped with Mavericks has a regression and doesn&#8217;t support pkcs8 keys. Mac OS X 10.8&#8217;s SSH supported these keys just fine.<\/p>\n<p>Earlier in the year I had read <a href=\"http:\/\/martin.kleppmann.com\/2013\/05\/24\/improving-security-of-ssh-private-keys.html\">an article<\/a> about using pkcs8 formatted keys to encrypt your SSH private keys more strongly. I went ahead and did this because 10.8 (and my Linux machines) supported it just fine. 10.9, however ships with a different SSH. &#8220;<tt>ssh -V<\/tt>&#8221; outputs:<\/p>\n<pre>OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011<\/pre>\n<p>The previous version did not have &#8220;OSSLShim&#8221;, but rather used OpenSSL. My guess is that Apple replaced OpenSSL with some sort of API shim to another (Apple built?) library that doesn&#8217;t have support for pkcs8. Weak.<\/p>\n<p>Anyway, the workaround is to use the <tt>openssl<\/tt> command line program to decrypt the key like this:<\/p>\n<pre>openssl pkcs8 -in ~\/.ssh\/id_rsa | ssh-add -<\/pre>\n<p>I put that in a file called &#8220;~\/mavericks_sucks&#8221; so that I can just do:<\/p>\n<pre>. mavericks_sucks<\/pre>\n<p>in the terminal after I boot my computer and then everything works after that.<\/p>\n<p>I&#8217;ve submitted a bug to <a href=\"http:\/\/bugreporter.apple.com\/\">Apple&#8217;s bug reporter<\/a>, but it was marked as a duplicate of\u00a0bug 14776937 but of course I can&#8217;t read\u00a0bug 14776937 or get status on it because Apple&#8217;s whole bug reporting system is a piece of crap. Oh well. Hopefully their stupid shim will support all the features of normal OpenSSL (before 10.10).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After upgrading to Mavericks (Mac OS X 10.9) I found that ssh-add wasn&#8217;t working. After investigating I discovered that the SSH shipped with Mavericks has a regression and doesn&#8217;t support pkcs8 keys. Mac OS X 10.8&#8217;s SSH supported these keys just fine. Earlier in the year I had read an article about using pkcs8 formatted &hellip; <a href=\"https:\/\/porkrind.org\/missives\/mac-os-x-10-9-mavericks-and-ssh-pkcs8-keys\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Mac OS X 10.9 (Mavericks) and SSH pkcs8 keys<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-443","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/porkrind.org\/missives\/wp-json\/wp\/v2\/posts\/443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/porkrind.org\/missives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/porkrind.org\/missives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/porkrind.org\/missives\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/porkrind.org\/missives\/wp-json\/wp\/v2\/comments?post=443"}],"version-history":[{"count":8,"href":"https:\/\/porkrind.org\/missives\/wp-json\/wp\/v2\/posts\/443\/revisions"}],"predecessor-version":[{"id":452,"href":"https:\/\/porkrind.org\/missives\/wp-json\/wp\/v2\/posts\/443\/revisions\/452"}],"wp:attachment":[{"href":"https:\/\/porkrind.org\/missives\/wp-json\/wp\/v2\/media?parent=443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/porkrind.org\/missives\/wp-json\/wp\/v2\/categories?post=443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/porkrind.org\/missives\/wp-json\/wp\/v2\/tags?post=443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}