{"id":1320,"date":"2012-09-05T15:45:07","date_gmt":"2012-09-05T07:45:07","guid":{"rendered":"http:\/\/rmohan.com\/?p=1320"},"modified":"2012-09-05T15:45:07","modified_gmt":"2012-09-05T07:45:07","slug":"ssh-pki","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=1320","title":{"rendered":"SSH PKI"},"content":{"rendered":"<p>To create ssh keys:<br \/>ssh-keygen -t dsa -d 2048<br \/>Optionally leave the passphrase blank<br \/>This will create a ~\/.ssh\/id_dsa and ~\/.ssh\/id_dsa.pub file.<\/p>\n<p>Check for validity:<br \/>ssh-keygen -l -f ~\/.ssh\/id_dsa.pub<\/p>\n<p>Copy the key to the remote server:<br \/>cat ~\/.ssh\/id_dsa ssh remote_host &#8216;sh -c &#8220;cat &#8211; &gt;&gt;~\/.ssh\/authorized_keys&#8221;&#8216;<\/p>\n<p>Convert commercial (SECSH) ssh private \/ public key to OpenSSH<br \/>ssh-keygen -i -f id_dsa.pub &gt; id_dsa_openssh.pub # public key <br \/>ssh-keygen -i -f id_dsa &gt; id_dsa_openssh # private key <\/p>\n<p><strong>Generate public key from private key<\/strong><br \/>ssh-keygen -y -f id_dsa &gt; id_dsa_openssh.pub<\/p>\n<p>Convert OpenSSH private \/ public to commercial (SECSH) ssh<br \/>ssh-keygen -e -f id_dsa_openssh.pub &gt; id_dsa.pub # public key<br \/>ssh-keygen -e -f id_dsa_openssh &gt; id_dsa # private key<\/p>\n<p><strong>Changes the passphrase <\/strong><br \/>ssh-keygen -p -N password -f id_dsa_openssh.prv &gt; id_dsa<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To create ssh keys:ssh-keygen -t dsa -d 2048Optionally leave the passphrase blankThis will create a ~\/.ssh\/id_dsa and ~\/.ssh\/id_dsa.pub file.<\/p>\n<p>Check for validity:ssh-keygen -l -f ~\/.ssh\/id_dsa.pub<\/p>\n<p>Copy the key to the remote server:cat ~\/.ssh\/id_dsa ssh remote_host &#8216;sh -c &#8220;cat &#8211; &gt;&gt;~\/.ssh\/authorized_keys&#8221;&#8216;<\/p>\n<p>Convert commercial (SECSH) ssh private \/ public key to OpenSSHssh-keygen -i -f id_dsa.pub &gt; id_dsa_openssh.pub [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1320"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1320"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1320\/revisions"}],"predecessor-version":[{"id":1321,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1320\/revisions\/1321"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}