LoginSignup
7
7

More than 5 years have passed since last update.

sshで複数の接続先に対して公開鍵で接続する設定

Posted at

例えばgithub.comとport forwardingで接続するgitサーバにそれぞれ異なる秘密鍵で接続する場合。

cygwinの場合は以下のように設定する

path_to_cygwin\home\username.ssh\config
ファイルを作成し、以下の内容を記載

Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/name_of_the_private_key_file

Host localhost
HostName localhost
User git
IdentityFile /cygdrive/c/Users/username/.ssh/name_of_the_private_key_file

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