Как настроить ssh для bitbucket

Доступ к bitbucket и github по ssh ключам

Если попытка склонировать любой приватный репозиторий с bitbucket или github по ssh вызывает ошибку вида:

То это значит, что вы не прошли авторизацию по ssh-ключам. Тут 2 варианта:

  1. Клонировать через https схему, при этом будет запрошен имя пользователя и пароль от аккаунта. Минус тот, что при любом обращении к центральному серверу (пр. git fetch , git pull ) придётся снова вводить пароль.
  2. Настроить ssh-ключи, чтобы git-аутентификация проходила автоматически без ввода паролей и т.д.

Если ключи у вас уже есть, то читайте сразу как добавить ssh ключ на github или добавить ssh ключ на bitbucket.

Рассмотрим подробнее как 1. создать ssh-ключи на linux (ubuntu) и добавить ssh ключи на 2. github и 3. bitbucket.

Генерация ssh-ключей

Для генерации ssh-ключа выполняем следующие команды:

После этого будет предложено ввести имя файла с ключами, либо если имя файла не указать, ключи будут созданы в файле id_rsa. Задаём имя файла с ключами, например, как «git_rsa«. Таким образом мы будем знать, что этот ssh-ключ используется конкретно для git-авторизации. Хотя, никто не запрещает использовать один и тот же ключ id_rsa. Ключи будут храниться в домашней директории пользователя

На запрос о установке пароля на связку ключей можно нажать enter, т.е. оставить пароль пустым (это безопасно). Теперь в каталоге

/.ssh появились 2 файла ключа:

  • git_rsa — приватный, который нельзя никому сообщать
  • git_rsa.pub — публичный, который мы сообщим gitbucket и github

По умолчанию при подключении к серверу для ssh-авторизации используется ключ с именем id_rsa. Мы это обойдём. Чтобы не указывать имя нужного нам ключа (git_rsa) при каждом подключении к серверу, отредактируйте файл

/.ssh/config (если файла ещё нет, создайте), добавьте содержимое для идентификации bitbucket-хоста и github:

Всё, на нашем комьютере или сервере (смотря где создавали ключи) нужные ключи созданы. Остаётся сообщить (добавить) наш публичный ключ туда, где мы будем проходить авторизацию, т.е. на github и bitbucket.

Добавление ssh-ключа на github

В своём профиле нажимаем Edit Profile -> SSH Keys -> Add SSH key.

В свежем интерфейсе github:

  1. кликаем на иконку профиля в правом верхнем углу, далее
  2. выбираем меню Settings
  3. в меню слева выбираем SSH and GPG keys
  4. Жмем кнопку New SSH key.

В форме добавления ключа указываем title (это название ключа, вводится для удобства, не на что не влияет) и key (это сам ключ, т.е. вставляем сюда всё содержимое файла

/.ssh/git_rsa.pub). Нажимаем Add key.

Добавление ssh-ключа на bitbucket

Авторизуемся, заходим в свой аккаунт. Нажимаем SSH keys -> Add Key. После ввода ключа в попап окошке нажимаем кнопку Add key для сохранения ssh-ключа.

Теперь вы можете клонировать свои приватные репозитории по ssh (git@github) без ввода пароля.

На что стоит обратить внимание если ssh-авторизация по ключу все еще не работает:

  • Как удалить сабмодуль в git? Решено!
  • Как добавить на linux сервер мой публичный ключ для входа по ssh по ключу без пароля? 2 ответа
  • Как посмотреть diff файлов которые в индексе git? Решено!
  • Как отменить последний коммит в git? Решено!
  • Как очистить git stash? Решено!
  • git. Настройка git 0 комментариев
  • git алиасы 0 комментариев
  • Отправить Pull Request в чужой репозиторий на github 0 комментариев
  • Настройка прав для id_rsa (bad permissions) 0 комментариев
  • Сказать git какой из ssh-ключей использовать 0 комментариев

Комментарии 5

Мне вообще уже этот «Permission denied (publickey).» всю печёнку выел!
Суть такова: есть боевой проект на jino.ru, есть репо на bitbucket-е, есть локальная версия. Сгенерил путтигеном ключи. Публичный положил на сервер в папку .ssh и добавил ключ к аккаунту на битбаккете. У себя на ПК в путти-агенте активировал приватный ключ — все должно заработать, ан нет! В путти пытаюсь запулить или запушить изменения в связке бой-битбакет — постоянно такая шняга вылезает:

«Warning: Permanently added the RSA host key for IP address ‘2406:da. e9:9f55’ to the list of known hosts.
Permission denied (publickey).»

да, на бою в папке .ssh после первого запуска пула или пуша в путти был такой запрос:

»
The authenticity of host ‘bitbucket.org (2406:da0. 2c0:3470)’ can’t be established.
RSA key fingerprint is SHA256:zzX. YXaGp1A.
RSA key fingerprint is MD5:97:8c:1. aa:46:46:74:7c:40.
Are you sure you want to continue connecting (yes/no)?
»
как я понял, что-то в стиле «подлинность битбакета не установлена, хотите ли продолжить?». Я ответил согласием, после чего создался успешно файл known_hosts (на бою в папке с ключами), куда пишется ip битбаккета (как я понимаю) и дублируется строка из ключа доступа в том виде ,в котором лежит на битбакете. На др ресурсах вычитал, что чтобы Warning не выскакивал, нужно на бю в папке с ключами положить файл config без расширения и с содержимым «UserKnownHostsFile

/.ssh/known_hosts» — сделано. Права доступа на файл ключа на бою — 600, на остальные 2 файла (конфиг и хостс) — 644, на всю папку .ssh — 700.

Что еще нужно, чтобы пул/пуш заработал по ssh. Я уже в депрессии полнейшей!)) Может для доступа к самому репо на битбакете отдельные ключи нужно добавлять? Типа, к аккаунту на битбаккете подключается, а к репе уже нет?

Amati2007, с виду вы все делаете верно!
на битбакет публичный ключ достаточно добавить только в аккаунт. Можно и отдельно в каждый репозиторий добавлять ключ, но не обязательно.

Вот еще вы пишете, что в бою при запушить возникает ошибка «Permission denied (publickey)».
1) А как вы на боевой сервер подключаетесь? Вводите пароль или авторизуетесь по тому же самому ssh ключу? Если вводите пароль, то попробуйте для начала проверить ssh-авторизацию на хостинг по тому же ключу.
2) У вас одна единственная пара ключей создана и называется id_rsa по дефолту? Чтобы убедиться что один и тот же ключ используется для коннекта, тот же что на битбакет прописан.
3) а в

Читайте также:  Почему может не работать электрошокер

/.ssh/config нет ничего лишнего? Указания на какой-то левый ключ? Для чистоты эксперимента удалить файл)
4) known_hosts удалить для чистоты эксперимента, он должен сам создаваться при первом подключении (хотя возможно еще зависит от ssh-клиента).

Вообще, судя по ошибке, не нравится именно ключ: проверить что на битбакет залит нужный ключ. Может, стоит сгенерить новый ключ и проверить заново (старый удалить).

/.ssh/known_hosts и все. Изначально этого файла не было и без него всегда выдает Warning. если соединяюсь по ssh. С ним. с ним warning выдавать не должно, но выдает все равно, правда не всегда — если в путти сделать 4 раза подряд сделать попытку пуш или пулл, то этого сообщения нет. Оно появляется с 5-ой и далее попытки. И да, я еще приметил, что в тексте сообщения этого warning вторая часть (после ::) значения IP всегда разное. Например:
5-я попытка -> 2406:da00:ff00::6b17:d1f5
6-я попытка -> 2406:da00:ff00::22c2:513
7-я попытка -> 2406:da00:ff00::22c0:3470

и т.д.
То есть складывается такое ощущение, что у битбакета динамический IP, хотя, по-идее, для таких подключений должен быть набор статичных. Они даже их список где-то публиковали.
4) Да, если я удаляю known_hosts, то при попытке пула / пуша в путти вначале идет запрос про ключи The authenticity of host ‘. (полный текст я приводил в основном сообщении), а когда я отвечаю на него Yes, то known_hosts на сервере создается заново.

Ремарка: если пробовать работать с репо не по ssh, а по https, то происходит следующее: при заходе в путти по логин/паролю все успешно, при попытке пулл/пуш просит пароль — я его ввожу тот, что от аккаунта битбакета и, вуаля, меня не пускает. все тот же «Доступ запрещен», хотя локальная связка работает и я могу как принимать файлы с битбакета на локал, так и отправлять изменения обратно.

Источник

Использование GitHub и Bitbucket без пароля с помощью SSH.

При выполнении команд git в консоли для связи с удаленным репозиторием, приходится каждый раз вводить свои регистрационные данные. Но кроме входа по вводу логина и пароля, можно использовать SSH, так как вместо этого используется пара ключей — открытый и закрытый.
Приведу краткую инструкцию по созданию и использованию SSH для git.

Прежде всего можно посмотреть есть ли уже ключи:

Если в списке есть файлы с таким окончанием:
-rw-r—r— 1 USER 197121 3247 июл 2 18:49 id_rsa
-rw-r—r— 1 USER 197121 739 июл 2 18:49 id_rsa.pub

значит ключ уже есть и можно новый не создавать.
Найти данные ключи можно в этой папке:
C:/Users/ВАШЕ_ИМЯ/.ssh

Если ключ нужно создать, то в консоли git:
где в консоли нужно указать ваш электронный адрес (используется в качестве метки)
При этом предложат ввести ответы на 3 вопроса, на которые можно просто нажать Enter. В т.ч. там предложат задать контрольную фразу, которую нужно будет вводить каждый раз. Чтобы этого не делать – не задаем ее.
После выполнения появился текст с рисунком из символов.

Набираем
и смотрим на вывод. Он должен быть похож на следующий:

Это SSH-url-ы. Если это не так и они начинаются с https://github.com/, то
— перейти на страницу нужного проекта на GitHub,
— нажать на зеленую кнопку «Clone or download»;
— нажать ссылочку Use SSH и скопировать адрес;
— подставить его после git remote set-url origin, чтобы получилось что-то вроде
выполнить команду.

Запуск ssh-агента:
появится надпись на подобии:
Agent pid 6684

Добавить созданные ключи к ssh-агенту:
появилась надпись на подобии:
Identity added: /c/Users/fghfgh/.ssh/id_rsa (/c/Users/fghfgh/.ssh/id_rsa)

Для вставки ключа на GitHub, скопируем ключ в буфер обмена:
так же можно просто скопировать текст из файла id_rsa.pub

Регистрация ключа на GitHub или Bitbucket.

Для GitHub переходим в свой аккаунт, далее Settings — в левом меню пункт «SSH and GPG keys» или просто перейдите по этой ссылке:
https://github.com/settings/keys

Указываем произвольное имя ключа, например «key» и вставляем из буфера блок кода ключа. После этого жмем кнопку – «Add SSH key».

Для Bitbucket все аналогично, панель добавления ключа находится в Настройки — блок «БЕЗОПАСНОСТЬ «.

Все готово, теперь при выполнении команды
не придется каждый раз вводить логин и пароль.

Источник

Блог начинающего сисадмина

Здесь уже не будет ничего интересного, лучше загляните сюда: https://medium.com/@Amet13

четверг, 29 декабря 2016 г.

Авторизация по ssh-ключу в Bitbucket

Задача: создать локальный репозиторий и пушить его в приватный репозиторий на Bitbucket.
В качестве примера покажу на примере конфигов для Ansible.

Ставим git и настраиваем пользователя:
# git config —global user.email «[email protected]»
# git config —global user.name «Vasya Pupkin»
# git config —global color.ui true

Идем в аккаунт Bitbucket и создаем репозиторий например с именем repoName .
Далее переходим в каталог проекта и указываем ему удаленный репозиторий:
# cd /etc/ansible
# git init
# git remote add origin [email protected]:userName/repoName.git

После этого уже можно пушить в удаленный репозиторий через логин/пароль, я же не хочу постоянно вводить пароль и собираюсь пушить с помощью SSH-ключа.

Генерируем пару ключей:
# ssh-keygen -t rsa -f /root/.ssh/bitbucket

Идем в профиль Bitbucket (https://bitbucket.org/account/user/userName/ssh-keys/) и добавляем SSH-ключ (содержимое файла /root/.ssh/bitbucket.pub )

Далее нужно в конфиге SSH указать, что по умолчанию к хосту bitbucket.org нужно подключаться не со стандартным ключом, а с нашим:
# vim /root/.ssh/config
Host bitbucket.org
IdentityFile /root/.ssh/bitbucket

Проверка соединения:
# ssh -T [email protected]
logged in as userName.
You can use git or hg to connect to Bitbucket. Shell access is disabled.

Источник

Set up an SSH key

When you set up SSH key, you create a key pair that contains a private key (saved to your local computer) and a public key (uploaded to Bitbucket). Bitbucket uses the key pair to authenticate anything the associated account can access. This two-way mechanism prevents man-in-the-middle attacks.

This first key pair is your default SSH identity. If you need more than a default identity, you can set up additional keys.

For security reasons, we recommend that you generate a new SSH key and replace the existing key on your account at least once a year.

You can’t use the same key between accounts. You must create new keys for each individual Bitbucket account.

Set up SSH for Git on Windows

Use this section to create a default identity and SSH key when you’re using Git on Windows. By default, the system adds keys for all identities to the /Users/ /.ssh directory.

Step 1. Set up your default identity

From the command line, enter ssh-keygen .

For Windows 7 or earlier

You can only enter ssh-keygen into the Git Bash window. It won’t work in the Command prompt.

The command prompts you for a file to save the key in:

$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/emmap1/.ssh/id_rsa):

2. Press enter to accept the default key and path, /c/Users/ /.ssh/id_rsa .

We recommend keeping the default key name unless you have a reason to change it. To create a key with a non-default name or path, specify the full path to the key. For example, to create a key called my-new-ssh-key , enter the Windows path, shown here:

Читайте также:  Почему может не работать кнопка prt sc

$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/emmap1/.ssh/id_rsa): c:\Users\emmap1\.ssh\my-new-ssh-key

3. Enter and re-enter a passphrase when prompted.

The command creates your default identity with its public and private keys. The whole interaction looks similar to this:

$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/emmap1/.ssh/id_rsa):
Created directory ‘/c/Users/emmap1/.ssh’.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/emmap1/.ssh/id_rsa.
Your public key has been saved in /c/Users/emmap1/.ssh/id_rsa.pub.
The key fingerprint is: e7:94:d1:a3:02:ee:38:6e:a4:5e:26:a3:a9:f4:95:d4 emmap1@EMMA-PC

4. List the contents of .ssh to view the key files.

You should see something like the following:

$ dir .ssh
id_rsa id_rsa.pub

The command displays two files, one for the public key (for example id_rsa.pub ) and one for the private key (for example, id_rsa ).

Step 2. Add the key to the ssh-agent

If you don’t want to type your password each time you use the key, you’ll need to add it to the ssh-agent.

To start the agent, run the following:

$ eval $(ssh-agent)
Agent pid 9700

Enter ssh-add followed by the path to the private key file:

Step 3. Add the public key to your Account settings

From Bitbucket, choose Personal settings from your avatar in the lower left.

Click SSH keys. If you’ve already added keys, you’ll see them on this page.

Open your .ssh/id_rsa.pub file (or whatever you named the public key file) and copy its contents.
You may see an email address on the last line. It doesn’t matter whether or not you include the email address.

From Bitbucket, click Add key.

Enter a Label for your new key, for example, Default public key .

Paste the copied public key into the SSH Key field.

Click Save.
Bitbucket sends you an email to confirm the addition of the key.

Return to the command line and verify your configuration and username by entering the following command:

$ ssh -T git@bitbucket.org

The command message tells you which of your Bitbucket accounts can log in with that key.

If you get an error message with Permission denied (publickey) , check the Troubleshoot SSH issues page for help.

Now that you’ve got an SSH key set up, use the SSH URL the next time you clone a repository. If you already have a repository that you cloned over HTTPS, change the remote URL for your repository to its SSH URL.

Edit an SSH key

After you add a key, you can edit the key’s Label but not the key itself. To change the key’s contents, you need to delete and re-add the key.

Set up SSH on macOS/Linux

Use this section to create a default identity and SSH key on macOS or Linux. By default, the system adds keys to the /Users/ /.ssh directory on macOS and /home/ /.ssh on Linux.

Step 1. Set up your default identity

1. From the terminal, enter ssh-keygen at the command line.
The command prompts you for a file to save the key in:

$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/emmap1/.ssh/id_rsa):

2. Press the Enter or Return key to accept the default location.

We recommend you keep the default key name unless you have a reason to change it.

To create a key with a name or path other than the default, specify the full path to the key. For example, to create a key called my-new-ssh-key , enter a path like the one shown at the prompt:

$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/emmap1/.ssh/id_rsa): /Users/emmap1/.ssh/my-new-ssh-key

3. Enter and re-enter a passphrase when prompted.
The command creates your default identity with its public and private keys. The whole interaction will look similar to the following:

$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/emmap1/.ssh/id_rsa):
Created directory ‘/Users/emmap1/.ssh’.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/emmap1/.ssh/id_rsa.
Your public key has been saved in /Users/emmap1/.ssh/id_rsa.pub.
The key fingerprint is:
4c:80:61:2c:00:3f:9d:dc:08:41:2e:c0:cf:b9:17:69 emmap1@myhost.local
The key’s randomart image is:
+—[ RSA 2048]—-+
|*o+ooo. |
|.+.=o+ . |
|. *.* o . |
| . = E o |
| o . S |
| . . |
| . |
| |
| |
+——————+

4. List the contents of

/.ssh to view the key files.

/.ssh
id_rsa id_rsa.pub

The command displays two files, one for the public key (for example id_rsa.pub ) and one for the private key (for example, id_rsa ).

Step 2. Add the key to the ssh-agent

If you don’t want to type your password each time you use the key, you’ll need to add it to the ssh-agent.

To start the agent, run the following:

$ eval `ssh-agent`
Agent pid 9700

Enter ssh-add followed by the path to the private key file:

macOS $ ssh-add -K

(macOS only) So that your computer remembers your password each time it restarts, open (or create) the

/.ssh/config file and add these lines to the file:

Step 3. Add the public key to your Account settings

From Bitbucket, choose Personal settings from your avatar in the lower left.

Click SSH keys.
If you’ve already added keys, you’ll see them on this page.

In your terminal window, copy the contents of your public key file. If you renamed the key, replace id_rsa.pub with the public key file name.

On Linux, you can cat the contents:

On macOS, the following command copies the output to the clipboard:

Select and copy the key output in the clipboard.
If you have problems with copy and paste, you can open the file directly with Notepad. Select the contents of the file (just avoid selecting the end-of-file characters).

From Bitbucket, click Add key.

Enter a Label for your new key, for example, Default public key .

Paste the copied public key into the SSH Key field.
You may see an email address on the last line when you paste. It doesn’t matter whether or not you include the email address in the Key.

Click Save.
Bitbucket sends you an email to confirm the addition of the key.

Return to the terminal window and verify your configuration and username by entering the following command:

$ ssh -T git@bitbucket.org

The command message tells you which of your Bitbucket accounts can log in with that key.

If you get an error message with Permission denied (publickey) , check the Troubleshoot SSH issues page for help.

Now that you’ve got an SSH key set up, use the SSH URL the next time you clone a repository. If you already have a repository that you cloned over HTTPS, change the remote URL for your repository to use its SSH URL.

Читайте также:  Не запускается материнская плата работают вентиляторы спикер молчит

Edit an SSH key

After you add a key, you can edit the key’s Label but not the key itself. To change the key’s contents, you need to delete and re-add the key.

Set up SSH with Sourcetree on Windows

Use this section to generate an SSH key using Sourcetree. When you create an SSH key with Sourcetree, you can save the public and private key wherever you want locally. You may want to create an SSH directory when you do, so that you can refer to your SSH keys whenever you need them.

Step 1. Install Sourcetree and add your Bitbucket account

If you don’t yet have Sourcetree, go to https://www.sourcetreeapp.com/ and click the Download free button.

Click the .exe file to install Sourcetree. Refer to the Install Sourcetree page for more details.

You may see the Load SSH Key? dialog after installation. Click No if you don’t have one and want to use Sourcetree to create one.

Add your account and select SSH as the Preferred Protocol. If you don’t connect your account during set up, click Remote to open the Remote repositories page and click Add an account.

Step 2. Create an SSH key

From Tools, select Create or Import SSH Keys.

From the PuTTY Key Generator dialog, click the Generate button.

As the SSH key generates, hover your mouse over the blank area in the dialog. It may take a minute or two.
When SSH key generation is complete, you see the public key and a few other fields.

Enter a passphrase for your SSH key in the Key passphrase and Confirm passphrase fields.

Click Save public key. From the save dialog, choose where to save your public key, name the file with the .pub file extension, and click Save.

Click Save private key. From the save dialog, choose where to save your private key, name the file, and click Save.

Close the PuTTY Key Generator dialog.

Step 3. Install your private key on Pageant

Sourcetree comes with an SSH authentication agent called Pageant. Load your private key into Pageant to automatically authenticate so that you don’t need to enter your passphrase.

Double-click the Pageant (PuTTY Authentication Agent) icon in your system tray to open the Pageant Key List dialog.

Click the Add Key button to open the Select Private Key File dialog.

Navigate to the private key file you saved in Step 1 and click Open.

Enter the passphrase for your SSH key and click OK.
Pageant shows your key in the running list.

Click Close.

Step 4. Add the public key to your Account settings

From Sourcetree, open the PuTTY Key Generator dialog by going to Tools > Create or Import SSH Keys.

Click Load, navigate to your SSH folder, and click the private key. Make sure you’re looking at All files if you don’t see your private key.

Enter your passphrase for the SSH key and click OK.

Copy the public key in the first field.

From Bitbucket, choose Personal settings from your avatar in the lower left.
The Account settings page opens.

Click SSH keys.
If you’ve already added keys, you’ll see them on this page.

Click Add key.

Enter a Label for your new key, for example, Default public key .

Paste the copied public key into the SSH Key field.

Click Save.
Bitbucket sends you an email to confirm the addition of the key.

Now that you’ve got an SSH key set up, use the SSH URL the next time you clone a repository. If you already have a repository that you cloned over HTTPS, change the remote URL for your repository to its SSH URL.

Edit an SSH key

After you add a key, you can edit the key’s Label but not the key itself. To change the key’s contents, you need to delete and re-add the key.

Set up SSH with Sourcetree on macOS

When you create an SSH key with Sourcetree on macOS, you can only create one key. You’ll need to use the command line if you want additional keys.

Step 1. Install Sourcetree and add your Bitbucket account

If you don’t yet have Sourcetree, go to https://www.sourcetreeapp.com/ and click the Download free button.

Open the ZIP file to install Sourcetree. Refer to the Install Sourcetree page for more details.

If you don’t connect your account during set up, you can add it from the Accounts tab by selecting Preferences from the Sourcetree menu.

Step 2. Create an SSH key

Follow these steps if you don’t already have an SSH key for an account. If you do have an SSH key and you want to generate another key, you’ll have to use the terminal because you can’t use Sourcetree to create a second key.

Creating an SSH key looks something like this:

From the Sourcetree menu, select Preferences.

Click the Accounts tab, select the account where you want to add the SSH key and click Edit.

Change the Protocol to SSH if it’s not already selected.

Hold down the OPTION key on your keyboard to see the Generate Key button.

If you’ve already generated an SSH key for this account from Sourcetree, the OPTION key won’t do anything. Use your existing key or generate another key from the terminal.

Click Generate Key.

Enter a passphrase for the SSH key in the Passphrase and Confirm Passphrase fields.

Click Create.

Step 3. Add the public key to your Account settings

From Bitbucket, choose Personal settings from your avatar in the lower left.
The Account settings page opens.

Click SSH keys.
If you’ve already added keys, you’ll see them on this page.

Select your account from your Accounts tab in Sourcetree.

Click the Copy to Clipboard button to copy your public SSH key.

From Bitbucket, click Add key.

Enter a Label for your new key, for example, Default public key .

Paste the copied public key into the SSH Key field.

Click Save.
Bitbucket sends you an email to confirm the addition of the key.

Now that you’ve got an SSH key set up, use the SSH URL the next time you clone a repository. If you already have a repository that you cloned over HTTPS, change the remote URL for your repository to its SSH URL.

Edit an SSH key

After you add a key, you can edit the key’s Label but not the key itself. To change the key’s contents, you need to delete and re-add the key.

Источник

Оцените статью