使用 SSH 从 BitBucket pip 安装自定义包,无需输入 SSH 密码

2024-03-26

我正在尝试使用pip install git+ssh://[email protected] /cdn-cgi/l/email-protection/my_org/my_package_repo.git从 BitBucket 安装定制的 python 包(由多个应用程序共享),而无需输入 SSH 密码。

其中一个答案似乎有很多很好的信息这个问题 https://stackoverflow.com/questions/4830856/is-it-possible-to-use-pip-to-install-a-package-from-a-private-github-repository用于在 GitLab 等中执行此操作。还有一些可靠的支持信息here https://stackoverflow.com/questions/4830856/is-it-possible-to-use-pip-to-install-a-package-from-a-private-github-repository/4837571#4837571.

我已经在本地 Mac 和此 BitBucket 帐户之间设置了 SSH 密钥。我可以随时向该帐户推送/拉取代码,而无需重新输入 SSH 密码。为什么是pip install当命令不需要密码时git命令?有没有办法用 BitBucket 和我描述的设置来解决这个问题?

Update

当我运行GIT_SSH_COMMAND='ssh -vvv' pip install git+ssh://[email protected] /cdn-cgi/l/email-protection/my_org/my_package_repo.git评论中推荐的命令,我得到以下(已清理的)响应:

Collecting git+ssh://[email protected] /cdn-cgi/l/email-protection/my_org/my_package_repo.git
  Cloning ssh://[email protected] /cdn-cgi/l/email-protection/my_org/my_package_repo.git to /private/var/folders/hh/v8z4pvkn3kl14c9ty827578c0000gq/T/pip-req-build-i9q_8b83
  Running command git clone -q ssh://[email protected] /cdn-cgi/l/email-protection/my_org/my_package_repo.git /private/var/folders/hh/v8z4pvkn3kl14c9ty827578c0000gq/T/pip-req-build-i9q_8b83
  OpenSSH_8.1p1, LibreSSL 2.7.3
  debug1: Reading configuration data /Users/username/.ssh/config
  debug1: /Users/username/.ssh/config line 1: Applying options for *
  debug1: Reading configuration data /etc/ssh/ssh_config
  debug1: /etc/ssh/ssh_config line 47: Applying options for *
  debug1: Connecting to bitbucket.org port 22.
  debug1: Connection established.
  debug1: identity file /Users/username/.ssh/id_rsa type 0
  debug1: identity file /Users/username/.ssh/id_rsa-cert type -1
  debug1: identity file /Users/username/.ssh/id_dsa type -1
  debug1: identity file /Users/username/.ssh/id_dsa-cert type -1
  debug1: identity file /Users/username/.ssh/id_ecdsa type -1
  debug1: identity file /Users/username/.ssh/id_ecdsa-cert type -1
  debug1: identity file /Users/username/.ssh/id_ed25519 type -1
  debug1: identity file /Users/username/.ssh/id_ed25519-cert type -1
  debug1: identity file /Users/username/.ssh/id_xmss type -1
  debug1: identity file /Users/username/.ssh/id_xmss-cert type -1
  debug1: Local version string SSH-2.0-OpenSSH_8.1
  debug1: Remote protocol version 2.0, remote software version conker_a7531beec7 c7d1b850e369
  debug1: no match: conker_a7531beec7 c7d1b850e369
  debug3: fd 7 is O_NONBLOCK
  debug1: Authenticating to bitbucket.org:22 as 'git'
  debug3: hostkeys_foreach: reading file "/Users/username/.ssh/known_hosts"
  debug3: record_hostkey: found key type RSA in file /Users/username/.ssh/known_hosts:3
  debug3: load_hostkeys: loaded 1 keys from bitbucket.org
  debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected] /cdn-cgi/l/email-protection,rsa-sha2-256-c[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,rsa-sha2-512,rsa-sha2-256,ssh-rsa
  debug3: send packet: type 20
  debug1: SSH2_MSG_KEXINIT sent
  debug3: receive packet: type 20
  debug1: SSH2_MSG_KEXINIT received
  debug2: local client KEXINIT proposal
  debug2: KEX algorithms: curve25519-sha256,[email protected] /cdn-cgi/l/email-protection,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
  debug2: host key algorithms: [email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,rsa-sha2-512,rsa-sha2-256,ssh-rsa,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519
  debug2: ciphers ctos: [email protected] /cdn-cgi/l/email-protection,aes128-ctr,aes192-ctr,aes256-ctr,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection
  debug2: ciphers stoc: [email protected] /cdn-cgi/l/email-protection,aes128-ctr,aes192-ctr,aes256-ctr,[email protected] /cdn-cgi/l/email-protection,aes256-g[email protected] /cdn-cgi/l/email-protection
  debug2: MACs ctos: [email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,hmac-sha2-256,hmac-sha2-512,hmac-sha1
  debug2: MACs stoc: [email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,hmac-sha2-256,hmac-sha2-512,hmac-sha1
  debug2: compression ctos: none,[email protected] /cdn-cgi/l/email-protection,zlib
  debug2: compression stoc: none,[email protected] /cdn-cgi/l/email-protection,zlib
  debug2: languages ctos:
  debug2: languages stoc:
  debug2: first_kex_follows 0
  debug2: reserved 0
  debug2: peer server KEXINIT proposal
  debug2: KEX algorithms: [email protected] /cdn-cgi/l/email-protection,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,ext-info-s
  debug2: host key algorithms: ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss
  debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection
  debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection
  debug2: MACs ctos: [email protected] /cdn-cgi/l/email-protection,hmac-sha2-256,hmac-sha1,hmac-sha1-96
  debug2: MACs stoc: [email protected] /cdn-cgi/l/email-protection,hmac-sha2-256,hmac-sha1,hmac-sha1-96
  debug2: compression ctos: none
  debug2: compression stoc: none
  debug2: languages ctos:
  debug2: languages stoc:
  debug2: first_kex_follows 0
  debug2: reserved 0
  debug1: kex: algorithm: [email protected] /cdn-cgi/l/email-protection
  debug1: kex: host key algorithm: rsa-sha2-512
  debug1: kex: server->client cipher: [email protected] /cdn-cgi/l/email-protection MAC: <implicit> compression: none
  debug1: kex: client->server cipher: [email protected] /cdn-cgi/l/email-protection MAC: <implicit> compression: none
  debug3: send packet: type 30
  debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
  debug3: receive packet: type 31
  debug1: Server host key: ssh-rsa SHA256:serverhostkeyzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
  debug3: hostkeys_foreach: reading file "/Users/username/.ssh/known_hosts"
  debug3: record_hostkey: found key type RSA in file /Users/username/.ssh/known_hosts:3
  debug3: load_hostkeys: loaded 1 keys from bitbucket.org
  debug3: hostkeys_foreach: reading file "/Users/username/.ssh/known_hosts"
  debug3: record_hostkey: found key type RSA in file /Users/username/.ssh/known_hosts:11
  debug3: load_hostkeys: loaded 1 keys from 104.192.141.1
  debug1: Host 'bitbucket.org' is known and matches the RSA host key.
  debug1: Found key in /Users/username/.ssh/known_hosts:3
  debug3: send packet: type 21
  debug2: set_newkeys: mode 1
  debug1: rekey out after 134217728 blocks
  debug1: SSH2_MSG_NEWKEYS sent
  debug1: expecting SSH2_MSG_NEWKEYS
  debug3: receive packet: type 21
  debug1: SSH2_MSG_NEWKEYS received
  debug2: set_newkeys: mode 0
  debug1: rekey in after 134217728 blocks
  debug1: Will attempt key: /Users/username/.ssh/id_rsa RSA SHA256:rsasha256zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
  debug1: Will attempt key: /Users/username/.ssh/id_dsa
  debug1: Will attempt key: /Users/username/.ssh/id_ecdsa
  debug1: Will attempt key: /Users/username/.ssh/id_ed25519
  debug1: Will attempt key: /Users/username/.ssh/id_xmss
  debug2: pubkey_prepare: done
  debug3: send packet: type 5
  debug3: receive packet: type 7
  debug1: SSH2_MSG_EXT_INFO received
  debug1: kex_input_ext_info: server-sig-algs=<ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp521,[email protected] /cdn-cgi/l/email-protection,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection,[email protected] /cdn-cgi/l/email-protection>
  debug3: receive packet: type 6
  debug2: service_accept: ssh-userauth
  debug1: SSH2_MSG_SERVICE_ACCEPT received
  debug3: send packet: type 50
  debug3: receive packet: type 51
  debug1: Authentications that can continue: publickey
  debug3: start over, passed a different list publickey
  debug3: preferred publickey,keyboard-interactive,password
  debug3: authmethod_lookup publickey
  debug3: remaining preferred: keyboard-interactive,password
  debug3: authmethod_is_enabled publickey
  debug1: Next authentication method: publickey
  debug1: Offering public key: /Users/username/.ssh/id_rsa RSA SHA256:rsasha256zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
  debug3: send packet: type 50
  debug2: we sent a publickey packet, wait for reply
  debug3: receive packet: type 60
  debug1: Server accepts key: /Users/username/.ssh/id_rsa RSA SHA256:rsasha256zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
  debug3: sign_and_send_pubkey: RSA SHA256:rsasha256zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
  debug3: sign_and_send_pubkey: signing using rsa-sha2-512
Enter passphrase for key '/Users/username/.ssh/id_rsa':

您的日志未显示 SSH 需要密码。但一个密码短语(因为私钥是创建后加密存储的,受密码短语保护)。

这意味着任何pip install应该从 shell 完成eval $(ssh-agent); ssh-add ~/.ssh/id_rsa首先执行,以便缓存所述密码,并允许所有进程not需要任何输入,即可实现无人值守运行。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用 SSH 从 BitBucket pip 安装自定义包,无需输入 SSH 密码 的相关文章

  • ValueError:“连接”层需要具有匹配形状的输入(连接轴除外)

    我正在尝试为我的项目构建 Pix2Pix 并收到错误 值错误 Concatenate层需要具有匹配形状的输入 除了连接轴之外 获得输入形状 None 64 64 128 None 63 63 128 生成器是一个 U 网模型 我的输入高度
  • Pyenv 无法在 Cygwin 上安装 python: ModuleNotFoundError: No module named '_ctypes'

    我正在尝试设置 Cygwin 环境以使用 pyenv 来管理 python 版本 我没有管理员权限 所以我使用以下命令运行设置 no admin flag 我使用 Cygwin 包管理器应用程序解决了一些依赖关系 但我被困在了这一点上 Mo
  • Python 小数.InvalidOperation 错误

    当我运行这样的东西时 我总是收到此错误 from decimal import getcontext prec 30 b 2 3 Decimal b Error Traceback most recent call last File Te
  • 创建圆形图像 PIL Tkinter

    Currently I have a zoom feature in my application that works very well however I d like the actual zoom box to be a circ
  • 我怎样才能在python cgi中找到上传的文件名

    我制作了如下简单的网络服务器 import BaseHTTPServer os cgi import cgitb cgitb enable html
  • 创建一个打开文件并创建字典的函数

    我有一个正在处理的文件 我想创建一个读取文件并将内容放入字典中的函数 然后该字典需要通过 main 函数传递 这是主程序 它无法改变 我所做的一切都必须与主程序配合 def main sunspot dict file str raw in
  • Django 如何从 ManyToManyField 序列化并列出全部

    我正在使用 Django 1 9 1 开发移动应用程序后端 我实现了关注者模型 现在我想列出用户的所有关注者 但目前我不得不这样做 我还使用 Django Rest 框架 这是我的 UserProfile 模型 class UserProf
  • 可移植的非关系数据库

    我想尝试 尝试非关系数据库 最好的解决方案是 便携式 这意味着它不需要安装 理想情况下 只需将目录复制粘贴到某个地方即可使其工作 我不介意第一次使用时是否需要编辑一些配置文件或运行配置工具 可从 python 访问 适用于 Windows
  • 对图像使用 Pixellib 自定义训练时出现 input_image 元形状错误

    我正在使用 Pixellib 来训练自定义图像实例分割 我创建了一个数据集 可以在下面的链接中看到 数据集 https drive google com drive folders 1MjpDNZtzGRNxEtCDcTmrjUuB1ics
  • 理解@property装饰器和继承[重复]

    这个问题在这里已经有答案了 这里是 Python 3 以防万一它很重要 我试图正确理解如何实现继承 property使用 我已经搜索了 StackOverflow 并阅读了大约 20 个类似的问题 但无济于事 因为他们试图解决的问题略有不同
  • 向 Python 2.6 添加 SSL 支持

    我尝试使用sslPython 2 6 中的模块 但我被告知它不可用 安装OpenSSL后 我重新编译2 6 但问题仍然存在 有什么建议么 您安装了 OpenSSL 开发库吗 我必须安装openssl devel例如 在 CentOS 上 在
  • 在 MATLAB 中创建共享库

    一位研究人员在 MATLAB 中创建了一个小型仿真 我们希望其他人也能使用它 我的计划是进行模拟 清理一些东西并将其变成一组函数 然后我打算将其编译成C库并使用SWIG https en wikipedia org wiki SWIG创建一
  • Floyd-Warshall 算法:获取最短路径

    假设一个图由一个表示n x n维数邻接矩阵 我知道如何获得所有对的最短路径矩阵 但我想知道有没有办法追踪所有最短路径 Blow是python代码实现 v len graph for k in range 0 v for i in range
  • Flask SQLAlchemy 与 MyPy - 模型类型错误

    我遇到了以下组合问题flask sqlalchemy and mypy 当我定义一个新的 ORM 对象时 例如 class Foo db Model pass where db是使用创建的数据库SQL炼金术应用于flask app mypy
  • 如何使用数据库在 Django 中的应用程序之间交换数据?

    我正在使用 Django 在网络上工作 我创建了 2 个应用程序 第一个用于客户端注册并将其数据添加到数据库 第二个应用程序供用户访问和查看交互界面 这个想法是使用第二个应用程序从数据库中的客户端获取数据 并使用它向用户显示一些信息 我的问
  • 在 scrapy 中将基本 url 与结果 href 结合起来

    下面是我的蜘蛛代码 class Blurb2Spider BaseSpider name blurb2 allowed domains www domain com def start requests self yield self ma
  • Jupyter Notebook 中的多处理与线程

    我试图测试这个例子here https ipywidgets readthedocs io en stable examples Widget 20Asynchronous html将其从线程更改为多处理 在 jupyter Noteboo
  • django 组合对两个不同基本模型的查询

    我有两个不同的查询集 我想将两个查询集合并 q1 tbl nt 123 objects values list id value geometry filter restriction height exclude condition id
  • 测试中的模型 - Django 1.7 问题

    我正在尝试将我的项目移植为使用 Django 1 7 除了一件事之外 一切都很好 测试文件夹内的模型 Django 1 7 新迁移在内部运行 migrate 命令 在运行syncdb之前 这意味着如果模型未包含在迁移中 它将不会填充到数据库
  • 在读/写二进制数据结构时访问位域

    我正在为二进制格式编写一个解析器 这种二进制格式涉及不同的表 这些表同样采用二进制格式 通常包含不同的字段大小 其中 50 100 个之间 大多数这些结构都有位域 并且在 C 语言中表示时看起来像这样 struct myHeader uns

随机推荐

  • Android Studio更新:安装区域(studio.exe | uninstall.exe)中发现一些冲突

    当我启动 Android Studio 时 它会显示有关 1 1 版本新更新的弹出窗口 但是当我开始更新时 下载所有补丁文件后 重新启动时 它显示以下错误 我几乎在 Google 和 Stackoverflow 上到处搜索 已经有两个问题了
  • 我正在尝试在 boto3 周围输入注释,但模块“botocore.client”没有属性“EC2”

    我正在围绕 boto3 编写自己的包装器 以实现快速触发功能 我正在尝试输入注释内容boto3 session client ec2 返回 调试器说是
  • 给新手关于 N 层应用程序的建议

    好的 各位 这是给你们的另一篇 我开始涉足 n 层应用程序世界 我已经阅读了一些有关该主题的内容 一般建议是 n 层应用程序的目标是抽象层间功能 因此 基于此 在 n 层应用程序中 常规模型是 Data Access gt Business
  • 找到两个相似波形之间的时间偏移

    我必须比较两个时间与电压波形 由于这些波形源的特殊性 其中一个波形可以是另一个波形的时移版本 怎样才能知道是否有时移 如果是的话 多少钱 我正在 Python 中执行此操作 并希望使用 numpy scipy 库 scipy 提供了一个相关
  • 通用数组列表冒泡排序问题

    我知道有内置例程 但作为一名学习者 我想使用自己的设备进行排序 并且由于排序已经过时了 所以我决定尝试制作自己的例程generic如果我弄清楚它们在 Java 中的工作原理 我可以将其用于数字或字符串甚至日期的排序例程 这就是我所拥有的 将
  • 在 python 中实现 Bron–Kerbosch 算法

    对于一个大学项目 我正在尝试实施布隆 克博什算法 http en wikipedia org wiki Bron Kerbosch algorithm 即列出给定图中的所有最大团 我正在尝试实现第一个算法 不进行旋转 但是我的代码在测试后并
  • 如何更改 Netbeans 缓存目录?

    有什么方法可以更改 Netbeans 7 0 1 缓存目录吗 我只是不想更改几个应用程序的缓存 临时目录 其中之一是 NetBeans 对于 Netbeans 7 来说这似乎是不可能的 除非您重新定位整个用户目录或按照 MadWizard
  • 检查 AngularJs 指令中属性是否存在

    可以检查给定属性是否存在于指令中 理想情况下使用隔离范围 或者在最坏的情况下使用属性对象 指令看起来像这样
  • 信号执行期间的 sigprocmask

    我目前正在研究使用sigprocmask阻止某些信号 在这种情况下 SIGALRM and SIGCHLD 当关键代码段正在执行时 与这些信号关联的两个信号处理程序都将访问和修改中央数据结构 因此在主进程处理该数据结构时阻止它们访问它至关重
  • 将 youtube api 帮助程序集成到 iOS 时出现错误 258

    https developers google com youtube v3 guides ios youtube helper https developers google com youtube v3 guides ios youtu
  • 编写 SQL Server 权限脚本

    我想将我对存储过程和其他内容设置的所有权限从开发数据库复制到生产数据库 通过 SSMS GUI 工具手动完成这一切非常麻烦 更不用说容易出错 因此 我正在寻找一种方法 可以直接转储在一个数据库中设置的权限 并将这些相同的权限应用于单独的数据
  • 编辑所有视图和存储过程,查找和替换?

    有没有一种简单的方法可以在我的 SQL Server 数据库中的每个视图和存储过程中查找和替换字符串 我需要将 X United Kingdom 替换为 X UK 您需要查看sysobjects和syscomments 视图和存储过程的文本
  • 如何在 Google Visualization API 中进行多行注释?

    我正在尝试使用谷歌可视化 API 生成带注释的 LineChart 当我让它工作时 我希望能够在可能的情况下使注释具有换行符 不幸的是 Google 的 API 似乎忽略了任何换行信息并将所有内容显示在一行上 有人想出解决这个问题的办法吗
  • R htmlParse XML 中的编码问题

    我尝试抓取网站但无法处理此编码问题 putting together the url search str lt allintitle amphibian richness OR diversity url lt paste http sc
  • 如何在类库中定位EF生成的元文件?

    我已将 Entity Framework 4 模型移至类库 元文件构建到 bin Debug 我用来在类库中定位元文件的连接字符串是什么 我努力了
  • 将多个谓词函数组合为一个

    是否可以编写例如 defn multiple of three n zero mod n 3 defn multiple of five n zero mod n 5 into multiple of three or five 所以我可以
  • Grails 3 Spring Security 预身份验证

    我的应用程序使用 Grails 3 我正在尝试进行预身份验证 如此处所述article https docs spring io spring security site docs 3 0 x reference preauth html
  • 如何检查 Ruby 对象的方法?

    我想知道是否有一个 Ruby 方法调用仅显示由其调用的 Ruby 对象定义的方法 而不是由其祖先类定义的所有方法 这就是methods似乎是这样 methods采用可选的布尔参数 该参数指定是否还列出对象的类及其超类的方法或仅列出对象的单例
  • SQL“之间”不包含在内

    我有一个这样的查询 SELECT FROM Cases WHERE created at BETWEEN 2013 05 01 AND 2013 05 01 但即使 1 日有数据 也没有给出任何结果 created at好像2013 05
  • 使用 SSH 从 BitBucket pip 安装自定义包,无需输入 SSH 密码

    我正在尝试使用pip install git ssh email protected cdn cgi l email protection my org my package repo git从 BitBucket 安装定制的 python