ssh

Bitbucket用の.ssh/config設定

Host bitbucket.org HostName bitbucket.org Port 22 User git IdentityFile /path/to/id_rsa SSHキーペアはいつものように サーバー内で ssh-keygen -t rsa -b 2048 -C "hoge" して作る。

Githubに接続する際のSSH秘密鍵の指定

vi ~/.ssh/config Host github.com HostName github.com Port 22 User git IdentityFile ~/.ssh/id_rsa.example

Bitbucketからgit clone(SSH接続)

数年ぶりにbitbucketにリポジトリを作る用事ができた。 公開鍵はユーザーページのSettings => SSH keysから登録する。 いつもの公開鍵を登録後、早速リポジトリを作りクローンしようとしてみたら git@bitbucket.org: Permission denied (publickey). fatal: …

GitでSSH秘密鍵を指定してcloneする

.ssh/configでHostを設定した上で、 Host foo HostName 12.34.56.789 Port 2222 User bar IdentityFile path/to/secret_key そのHost名を指定してcloneする。 git clone ssh://bar@foo/path/to/repos.git