14
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

BacklogのGitからssh認証でgit cloneするには

Last updated at Posted at 2019-04-16

ハマったので備忘録

最初にユーザー名とホスト名を確認しましょう

プロジェクト-> Gitから、レポジトリ一覧がみれます。

sshを選択し、得られる文字列があると思いますが、以下のような順番になっています。git cloneで使う文字列です。
ユーザー名とホスト名が重要です。メモってください

ユーザー名@ホスト名:/プロジェクト名/レポジトリ名.git

ssh-keygenで鍵を作成

.sshで作るとひと手間省けます。

cd ~/.ssh/
ssh-keygen -t rsa -b 4096 -m pem -C "Backlog" -f id_rsa_backlog -N ""

Backlogにコピペで貼り付ける

個人設定->ssh公開鍵に公開鍵の情報を貼り付ける
(上記の例ではid_rsa_backlog.pub)

~/.ssh/configを書いてホストの解決

既存のconfigファイルがなければ作りましょう。

# ~/.ssh/config
Host ホスト名
  HostName ホスト名
  IdentityFile ~/.ssh/id_rsa_backlog
  User ユーザー名

適切なフォルダでgit clone

git clone ユーザー名@ホスト名:/プロジェクト名/レポジトリ名.git
14
18
1

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?