3

I have looked through docs and cannot find anywhere an example of how this might be achieved.

This question relates to this, in that I want to distribute updates but only to those that have a ssh key rather than using simple auth.

It works by looking at versions.gz file and then getting the most recent download. Is this possible with 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

Is there a way to authenticate others to download updates from my repository, or is this just a limitation of bitbucket and you must use public repo’s and to use private repo's give out your password with basic auth and cross fingers.

  • That's a very strange username you're using in your `ssh.connect` call. Nevertheless, this is an interesting question even if it isn't asked very well. – Beefster Jan 11 '18 at 00:10
  • The error is suggesting the network error. Also - I think you are confusing two protocols here `ssh` and `https`. I believe you want people to be able to download releases in a private repo only with valid keys right? – gabhijit Jan 11 '18 at 05:46
  • @gabhijit That is correct. Oauth2 and simple auth require others to have your login and pass and ssh does not work at all it seems –  Jan 11 '18 at 05:49
  • @gabhijit What solution had you in mind? –  Jan 11 '18 at 05:52

1 Answers1

1

Right from 2009, the download feature was described as:

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),

You cannot use ssh with username/password, as you don't have an account on the remote server (only 'git' has one).

You can see a download process in "Deploy build artifacts to Bitbucket Downloads"

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • This is very useful. I am having trouble getting it to work with python requests, but I did manage to get it work with Curl so it works at least –  Jan 11 '18 at 11:49