如何使用Bitbucket项目的SSH密钥? [英] How to use the SSH key for Bitbucket projects?

查看:237
本文介绍了如何使用Bitbucket项目的SSH密钥?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


$ b


  1. ssh-keygen -t rsa - 我的步骤在Bitbucket中生成并使用SSH密钥: C我的电子邮件

  2. cat〜/ .ssh / id_rsa.pub

  3. 将我的密钥 ssh-rsa AAAAB3Nz ...我的电子邮件复制到剪贴板

  4. 在bitbucket中访问我的配置> SSH密钥

  5. 在我的ubuntu控制台中添加密钥

  6. ,我使用命令: ssh -T git @ bitbucket .org

使用步骤6中的命令后,会出现以下消息:

  $ ssh -T git@bitbucket.org 
以ricardoramos身份登录。

您可以使用git或hg连接到Bitbucket。外壳访问被禁用。

当我推送我的存储库时,仍然继续需要我的密码。



不得不继续输入每次推送的密码。



我错在哪里?

解决方案

您无法使用SSH登录到bitbucket的shell,但您确实正确设置了密钥,否则您将无法获得Shell访问已禁用信息。



您需要做的是更改您的回购网址。现在你有一个HTTPS的URL设置,这需要一个密码。您可以切换到这样的SSH网址:

  git remote set-url origin [git repo的ssh url] 


My steps to generate and use the SSH key in Bitbucket:

  1. ssh-keygen -t rsa -C "my email"
  2. cat ~/.ssh/id_rsa.pub
  3. copy my key ssh-rsa AAAAB3Nz... my email to clipboard
  4. in bitbucket access my configuration > SSH keys
  5. add the key
  6. in console of my ubuntu, I use the command: ssh -T git@bitbucket.org

After using the command from step 6, the following message appears:

$ ssh -T git@bitbucket.org
logged in as ricardoramos.

You can use git or hg to connect to Bitbucket. Shell access is disabled.

When I make a push to my repository, still continues requiring my password.

It is very annoying to have to keep typing the password for every push.

Where am I wrong?

解决方案

You can't login to bitbucket's shell using SSH, but you did set up your key correctly, otherwise you wouldn't have gotten the "Shell access is disabled" message.

What you have to do is change the URL of your repo. Right now you have a HTTPS URL set, which requires a password. You can switch to an SSH URL like this:

git remote set-url origin [ssh url of your git repo]

这篇关于如何使用Bitbucket项目的SSH密钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆