LoginSignup
0
0

【メモ】githubへのpushやfetchでSSHキーのPWを毎回聞かれるのを回避

Posted at

あらかじめ、下記のコマンドなどで、SSHキーを作成しておく

ssh-keygen -t rsa -b 4096 -C “任意のメールアドレス"

以下を実行する

# SSHエージェントを起動
eval "$(ssh-agent -s)"

# SSHエージェントにSSHキーを追加
ssh-add ~/.ssh/id_rsa

SSHエージェントを自動起動する設定( .zshrcなどに記載 )

if [ -z "$SSH_AUTH_SOCK" ] ; then
    eval `ssh-agent -s`
    ssh-add
fi

.zshrcに記載する場合

vi ~/.zshrc

# `:qw`で抜けた後、更新内容を保存
source ~/.zshrc
0
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
0
0