LoginSignup
4
3

More than 5 years have passed since last update.

SSHのパスフレーズを生成した後から空パスフレーズにしたい時

Posted at

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.
4
3
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
4
3