Skip to content

Instantly share code, notes, and snippets.

@wnoguchi
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wnoguchi/3c81fd7a59fbde1c4baa to your computer and use it in GitHub Desktop.
Save wnoguchi/3c81fd7a59fbde1c4baa to your computer and use it in GitHub Desktop.
SSH key generation Tips.

SSH key generation Tips

OpenSSH

Generate SSH key pair

ssh-keygen -t rsa -b 2048 secure-private-key

Generate Public Key from Private Key

ssh-keygen -y -f secure-private-key

putty

Convert OpenSSH(pem) key format to Putty(ppk) key format

puttygen -O private secure-private-key.pem -o secure-private-key.ppk

Convert Putty(ppk) key format to OpenSSH(pem) key format

puttygen -O private-openssh secure-private-key.ppk -o secure-private-key.pem

なお、Homebrewでインストールしたputtygenだとエラーを吐いて死ぬ模様。
以下のコマンドで解決できる。
たまにサーバ自体が死んでいて失敗するときもあるので注意。

brew reinstall putty --HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment