LoginSignup
1
1

More than 5 years have passed since last update.

github で複数アカウントを切り替えるために複数の ssh key を扱う

Last updated at Posted at 2018-03-21

例えば、普段使いのgithub ssh keyがあり、一方で会社用のgithubを分けたい。sshとかだとどのキーを使うか指定できるが、gitだとそんなオプションなくてめんどい感じ。
この gist https://gist.github.com/jexchan/2351996 を参考にしようとしたが、実際もっと手順減らせたので記録。

普段使いの ~/.ssh/id_rsa と特別な ~/.ssh/id_rsa_special があると想定。

切り替え

$ ssh-add -d ~/.ssh/id_rsa
$ ssh-add ~/.ssh/id_rsa_special

戻す

$ ssh-add -d ~/.ssh/id_rsa_special
$ ssh-add ~/.ssh/id_rsa

以上っす。

1
1
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
1