子ページ
  • Adding an SSH key to your Stash account on Windows

Stash is now known as Bitbucket Server.
See the

Unknown macro: {spacejump}

of this page, or visit the Bitbucket Server documentation home page.

メタデータの末尾にスキップ
メタデータの先頭に移動

You can use SSH keys to establish a secure connection between your computer and Stash for when you are performing Git operations. In Stash, the option to clone using SSH only becomes available once you've added an SSH key to your user account – this page describes how to do that.

  • If you already have a key you want to usego to step 4 .
  • Your Stash administrator must have already enabled SSH access to Git repositories.
  • Supported key types are DSA and RSA2. RSA1 is not supported.

このページの内容

1. 既存の SSH キーの確認

You should check for existing SSH keys on your local computer. If you already have a key pair that you want to use, you can go to step 4.

コマンド プロンプトを開いて以下を実行します。

cd %userprofile%/.ssh
  • If you see "No such file or directory", then there aren't any existing keys: go to step 3.

  • すでにキーを持っているかどうかを確認します。

    dir id_*

    If there are existing keys, you may want to use them: go to step 4.

2. 古い SSH キーのバックアップ

If you have existing SSH keys, but you don't want to use them when connecting to Stash, you should back those up.

ローカル コンピューターのコマンド プロンプトで、以下を実行します。

mkdir key_backup
copy id_rsa* key_backup

3. 新しい SSH キーの生成

Now you can generate a new SSH key.

  1. ローカル コンピューターに管理者としてログインします。
  2. コマンド プロンプトで以下を実行します。

    ssh-keygen -t rsa -C "your_email@example.com"

    キーとメール アドレスを関連付けておくと、あとからキーを識別するのに役立ちます。

    Note that the ssh-keygen command is only available if you have already installed Git (with Git Bash).
    You'll see a response similar to this:

  3. Just press <Enter> to accept the default location and file name. If the .ssh directory doesn't exist, the system creates one for you.
  4. プロンプトが表示されたら、パス フレーズの入力と確認入力を行います。全体の流れは次のようになります。

  5. これで完了です。 

4. Add an SSH key to Stash

  1.   In your command prompt, change directory to the .ssh directory, and copy the public key file to your clipboard by running:

    cd %userprofile%/.ssh
    clip < id_rsa.pub
  2. In Stash, go to your account:

     

  3. Click on SSH keys and then Add key. 
  4. キーをテキスト ボックスに貼り付けます。


  5. Click Add key. You're done!
  • ラベルなし