manを打ってみる
man ssh-keygen
(中略)
-P passphrase
Provides the (old) passphrase.
-p Requests changing the passphrase of a private key file instead of creating a new private key. The program will prompt for the file containing
the private key, for the old passphrase, and twice for the new passphrase.
-p
オプションで対象の秘密鍵を指定すると、新しい鍵を生成する代わりにパスフレーズを変更してくれる模様です。
既にgithubで利用している秘密鍵なので、再登録する手間を省きたい場合はこのオプションが有用です。
$ ssh-keygen -p -f ~/.ssh/github/id_rsa
Enter old passphrase:
Enter new passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved with the new passphrase.
変更前
% git push origin feature/markdown_editor
Enter passphrase for key '*****/.ssh/github/id_rsa':
From github.com:himrock922/*****
* branch master -> FETCH_HEAD
Already up to date.
変更後
% git pull origin master
From github.com:himrock922/*****
* branch master -> FETCH_HEAD
Already up to date.