我查看了文档,但在任何地方都找不到有关如何实现这一点的示例。
这个问题与this有关,因为我想分发更新,但只分发给那些拥有 ssh key 的更新,而不是使用简单的身份验证。
它的工作原理是查看 versions.gz 文件,然后获取最新的下载。这对 ssH 可行吗?
import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
##ssh://git@bitbucket.org/Tysondogerz/ssh/downloads
ssh.connect('104.192.143.2', 8080, username='https://bitbucket.org/Tysondogerz/ssh/downloads/', password="", key_filename='C:\\Users\\Django\\.ssh\\id_rsa')
#TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
有没有一种方法可以验证其他人从我的存储库下载更新,或者这只是 bitbucket 的限制,您必须使用公共(public)存储库并使用私有(private)存储库,通过基本身份验证和交叉手指给出您的密码。
最佳答案
Right from 2009 ,下载功能被描述为:
If a repository is private, the URL for downloading a file will look a bit different (it will include an authentication token that is good for 24 hours),
您不能使用带有用户名/密码的 ssh,因为您在远程服务器上没有帐户(只有“git”有一个)。
在“Deploy build artifacts to Bitbucket Downloads”中可以看到一个下载过程
关于python - 如何使用 ssh 为 bitbucket/github 从私有(private)仓库下载文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48133559/