1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GitHub SSH 公開鍵の作成

Last updated at Posted at 2021-06-07

GitHubにSSHの設定をする

$ cd ~/.ssh

$ ls
authorized_keys2  id_dsa       known_hosts
config            id_dsa.pub

$ ssh-keygen

パスフレーズを二回入力するよう求められます。鍵を使うときにパスフレーズを入力したくない場合は、パスフレーズを空のままにしておきます。

$ cat ~/.ssh/id_rsa.pub

上記コマンドで出力されたログをコピー&ペーストでGitHubやらに貼る

GitHub に貼る

  1. 自分のアイコンをクリックして Settings をクリック
  2. SSH and GPG keysをクリック
  3. new SSH keysという緑色のボタンをクリック
  4. title に任意の名前、key に先程コピーしたものを貼る

もし、ssh で git push しているのにパスワードを求められたら

$ ls ~/.ssh
id_ed25519	id_ed25519.pub	known_hosts	known_hosts.old

$ ssh-add ~/.ssh/id_ed25519

参考:

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?