bitbucket 配置 SSH keys

目录

问题

配置方法

生成SSH key

添加SSH key至SSH Agent

添加公钥至Bitbucket

执行Git clone


问题

拉取bitbucket上的代码需要配置SSH key

Configure SSH and two-step verification | Bitbucket Cloud | Atlassian Support

以Linux为例:

Set up personal SSH keys on Linux | Bitbucket Cloud | Atlassian Support

配置方法

生成SSH key

  1. Open a terminal and navigate to your home or user directory using cd, for example:

    $ cd ~/.ssh/

  2. Generate a SSH key pair using ssh-keygen, such as:

    $ ssh-keygen -t ed25519 -b 4096 -C "{username@emaildomain.com}" -f {ssh-key-name}

    Where:

    • {username@emaildomain.com} is the email address associated with the Bitbucket Cloud account, such as your work email account.

    • {ssh-key-name} is the output filename for the keys. We recommend using a identifiable name such as bitbucket_work.

添加SSH key至SSH Agent

  1. To allow git to use your SSH key, an SSH agent needs to be running on your device.

    To check if it is already running, run the ps command. If the ssh-agent is already running, it should appear in the output, such as:

    $ ps -auxc | grep ssh-agent
    myusername      3291  0.0  0.0   6028   464 ?        Ss   07:29   0:00 ssh-agent

    To start the agent, run:

    $ eval $(ssh-agent)

  2. Run the following command, replacing the {ssh-key-name} with the name of the private key:

    $ ssh-add ~/.ssh/{ssh-key-name}

添加公钥至Bitbucket

 

执行Git clone

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值