[{"data":1,"prerenderedAt":155},["ShallowReactive",2],{"post:convert-putty-ppk-to-openssh":3},{"id":4,"title":5,"body":6,"date":142,"description":143,"draft":144,"extension":145,"meta":146,"navigation":147,"path":148,"seo":149,"stem":150,"tags":151,"__hash__":154},"posts\u002Fposts\u002Fconvert-putty-ppk-to-openssh.md","TIL: Convert Putty (PPK) SSH key file to OpenSSH key file",{"type":7,"value":8,"toc":134},"minimark",[9,21,26,29,40,44,47,53,56,62,70,77,83,109,115,118,122,128],[10,11,12,13,20],"p",{},"See the ",[14,15,19],"a",{"href":16,"rel":17},"https:\u002F\u002Fsuperuser.com\u002Fquestions\u002F232362\u002Fhow-to-convert-ppk-key-to-openssh-key-under-linux",[18],"nofollow","quick tutorial on SuperUser",".",[22,23,25],"h2",{"id":24},"step-one-install-putty","Step One: Install Putty",[10,27,28],{},"You need putty, or at least the tools that come with it.",[30,31,36],"pre",{"className":32,"code":34,"language":35},[33],"language-text","$ brew install putty \n$ # OR\n$ sudo apt install putty\n","text",[37,38,34],"code",{"__ignoreMap":39},"",[22,41,43],{"id":42},"step-two-generate-openssh-key-files","Step Two: Generate OpenSSH Key Files",[10,45,46],{},"Generate the private key from the PPK file:",[30,48,51],{"className":49,"code":50,"language":35},[33],"$ puttygen mborn.ppk -O private-openssh -o ~\u002F.ssh\u002FmyKey\n",[37,52,50],{"__ignoreMap":39},[10,54,55],{},"Generate the public key from the PPK file:",[30,57,60],{"className":58,"code":59,"language":35},[33],"$ puttygen mborn.ppk -O public-openssh -o ~\u002F.ssh\u002FmyKey.pub\n",[37,61,59],{"__ignoreMap":39},[22,63,65,66,69],{"id":64},"step-three-allow-ssh-dss-key-format","Step Three: Allow ",[37,67,68],{},"ssh-dss"," Key Format",[10,71,72,73,76],{},"For whatever reason, Putty seems to only support generating a key file in DSS format. This causes an error something like this (use the ",[37,74,75],{},"-v"," flag to display verbose errors in ssh):",[30,78,81],{"className":79,"code":80,"language":35},[33],"Skipping ssh-dss key \u002FUsers\u002Fme\u002F.ssh\u002FmyKey - not in PubkeyAcceptedKeyTypes\n",[37,82,80],{"__ignoreMap":39},[10,84,85,86,91,92,94,95,98,99,102,103,108],{},"This is because ",[14,87,90],{"href":88,"rel":89},"https:\u002F\u002Fwww.gentoo.org\u002Fsupport\u002Fnews-items\u002F2015-08-13-openssh-weak-keys.html",[18],"the ssh-dss key format was disabled in OpenSSH 7.0",". To re-enable ",[37,93,68],{},", add the following to your ",[37,96,97],{},"~\u002F.ssh\u002Fconfig"," file OR your global ",[37,100,101],{},"\u002Fetc\u002Fssh\u002Fssh_config"," file. (",[14,104,107],{"href":105,"rel":106},"https:\u002F\u002Fwww.digitalocean.com\u002Fcommunity\u002Fquestions\u002Fssh-refused-sshd-2444-userauth_pubkey-key-type-ssh-dss-not-in-pubkeyacceptedkeytypes-preauth",[18],"Thanks to gryphonitsolutions for the tip",".)",[30,110,113],{"className":111,"code":112,"language":35},[33],"PubkeyAcceptedKeyTypes=+ssh-dss\n",[37,114,112],{"__ignoreMap":39},[10,116,117],{},"(ps. I would love pointers on how to convert a PPK to RSA instead of DSS! This would save us from any issues with this step.)",[22,119,121],{"id":120},"step-four-reload-ssh-service","Step Four: Reload SSH Service",[10,123,124,125,127],{},"You may need to restart the SSH service if you made config updates in ",[37,126,101],{}," instead of your local config file:",[30,129,132],{"className":130,"code":131,"language":35},[33],"$ sudo launchctl stop com.openssh.sshd\n$ sudo launchctl start com.openssh.sshd\n",[37,133,131],{"__ignoreMap":39},{"title":39,"searchDepth":135,"depth":135,"links":136},2,[137,138,139,141],{"id":24,"depth":135,"text":25},{"id":42,"depth":135,"text":43},{"id":64,"depth":135,"text":140},"Step Three: Allow ssh-dss Key Format",{"id":120,"depth":135,"text":121},"2018-08-08T15:20:54-04:00","See the quick tutorial on SuperUser.",false,"md",{},true,"\u002Fposts\u002Fconvert-putty-ppk-to-openssh",{"title":5,"description":143},"posts\u002Fconvert-putty-ppk-to-openssh",[152,153],"bash","til","oD3odhHm-atdEaKMrLpHASCiKpMgIpfsrSSw8f3Cgbo",1790471528094]