Bitbucket Permission Denied / Conq

Hopefully this article will save at least one other person an hour of their life trying to figure out why they cannot clone a Bitbucket repository when using SSH.

My projects are broken into several teams, each with their own developer and administrator users.  Each team has a number of repositories that are being managed.  There is one common denominator; I have admin access to all repositories.   That means my Bitbucket user should have full read/write/admin privileges on all repos.    Yet no matter how many different keys I added to my Bitbucket user account it would not allow me to clone several repositories.

For those that want the short answer of what worked… use the “long form” SSH URL.

While I typically use the “short form”, as noted below, this absolutely would NOT work for certain repositories or different pre-shared keys even on a repository that uses the “short form”.   Sadly the short form is what Bitbucket serves up when you look at the clone interface on their website.  Here is a short form of the above URL:

Secure Access To Repos

With private repositories you always want to use some form of authentication to prevent people with the URL from cloning your project.   Your options with Bitbucket are to use an API Key , use OAuth, or setup SSH access with shared keys.    API Keys can be nice but you need to have an app that will manage your “handshake” with Bitbucket and interface with your git app or sytem-level network stacks.   OAuth is similar but allows more control with a user/password type setup so you lock out one person whereas the API key is an “everybody/nobody” solution.    SSH is already setup on any system you will use and with a little effort you can quickly learn how to create your public/private keys and share them.

Setting Up SSH

For Linux/OSX systems you can quickly setup your SSH keys by logging into the account you will using to do the clone.    You will need a .ssh directory and will generate your SSH keys.    There are plenty of articles on how to do that including Set up SSH on the Bitbucket site.   In short you will run ssh-keygen, copy the id_rsa.pub contents and add it under your user account in Bitbucket.

Cloning Your Repo

Normally you can just go to your directory and do something like this:

Maybe that is a bad example since that repository is wide open and won’t require security, but the concept is the same.    The problem is that for some repositories you get something like this:

That is very special.  It appears to be unique to Bitbucket , though I’ve not researched that so don’t take that statement as fact.   It also seems to only occur if you are running ssh-agent as instructed on that “Set up SSH” article cited above.

If you are not running SSH you may see this instead:

No “conq” but essentially the same message.

If you follow the “debugging SSH connections” article on Bitbucket they tell you to run the ssh -Tv git@bitbucket.org command to get some clues as to why your authentication failed.   The problem is that my SSH sessions were NOT failing when tracing the connection.  I was getting a valid connection to my user account on Bitbucket.

Finally, after all other possible solutions failed I tried the alternate URL format.   It cloned the repository.

Magic.  Black magic.   Possibly even evil.   But it works.

Hopefully this saves you from creating a dozen different SSH keys on a half-dozen different servers.  It may save you from setting up alternate identities or complex SSH authentication models.   You probably don’t even need to run an ssh-agent if you only have a single key for your login.    In short this simple trick may save you a lot of frustration.

And some people wonder why I’m bald.   Lifestyle choice?  Nah.  I’m just another code geek that has been at this for a long time.

 

iPhone Versus Android : Christmas 2015 Update

I just replaced my Samsung Galaxy S5 with a new iPhone 6S Plus.    This was not an easy transition.   I started out in the smart phone world literally on day 1.    We had a contract to write an app for the very first iPhone and we stood in line to purchase a pair of them on the first day they were available.    Within 18 months Android was out and after fighting with that gen 1 iPhone more than I liked it was time to check out the competition.   I never looked back even when iPhones improved faster than Androids.    Even when Androids didn’t work with ANYTHING and nearly EVERYTHING, including my toaster oven, “talked to” and iPhone.
 
But things have changed.   My past two go-arounds with the top-of-the-line Android models have been nearly as frustrating as that first iPhone many years ago.  First with an HTC model whose power ports just stopped connecting unless you moved the usb cable “just right”, like playing a new form of Jenga…. ooops moved that a little too far and CRASH down came the entire tower of tech.   Then with the latest Galaxy S5 that would literally just do a factory reset in the middle of streaming a Slacker station on a walk down the beach.     After the 5th factory reset in 12 months with a brand-new phone that tested “nothing wrong” with a perfect battery, I’d had enough.
Not only was my phone forcing me to spend a solid 4 hours re-installing all my apps and security settings, it would take less than a month to run out of memory.  If I was taking hundreds of photos and videos I could understand, but it was always the apps.  Not a lot of apps, but every one was HUGE.  Maybe It was the unprecedented amount of pre-installed apps you cannot install without rooting the phone (and voiding the warranty ) and keystroke log files that they keep to send back to everyone that wants to buy your data.  Privacy be damned.
To finally push me over the edge, yet another update came out for my car that was “only for iPhone”.   Starbucks continues to have iPhone-only free music and apps.    My stereo has advanced features only for iPhone.   My TV is “best with Apple TV compatible devices”.   My thermostat.  My security system.  Everything has MORE features and the most recent tech ONLY if you are on iPhone.   Even the smart door locks I looked at are NEVER available on Android first and even if they support Android it is always a half-assed version of the “real product” built for iPhone.
One last factory reset and a looming 4 hours of loss productivity pushed me over the edge.
In just 24 hours, here are my first impressions of the iPhone experience on the latest 6S Plus versus the year-old Android Samsung Galaxy S5.

iPhone killing it over Android

Battery life.   Bigger brighter screen with more resolution.   More sensors built in.  A gazillion megapixel camera.  A faster CPU.   And it STILL gets at least 5x the real-world usage time of the Galaxy S5.   After a day of use where I used the phone AT LEAST as much as any day in the past week with the Android and I still have 80% batter life.   My S5 would have been on the charger TWICE since noon.
Screen resolution.  A full 1920×1080 makes a HUGE different in legibility.   Also, Apple has always just had screens that “pop”.  They are easier to read no matter what the resolution is compared to an Android.  Not sure what tech magic this is but it makes a big difference to my eye.
Camera resolution.   I’m not sure the official spec but I now the video shoots true 4k at 30fps and full HD but the still images.  Wow.  This thing blows away the S5.  It has to be at least 3x the resolution if not more.
Ease-of-setup.   They literally activated the sim card and ported the account.  Nearly EVERYTHING was imported properly in terms of contacts, email, etc.    The few apps I had to re-install for security reasons worked perfectly.  EXCEPT a couple of Google-specific apps.  Go figure.    Funny thing is restoring an Android backup to the SAME PHONE after any one of the 5 factory resets was a 4-hour operation.    To go to a whole new phone OS took all of 15 minutes.
Performance.  This phone is WAY faster.   Literally the first words out of the Verizon rep when picking up the S5 was “your phone is so laggy”.  Yup.   Does that within 2 days of being setup.    Even after a factory reset and comparing them side-by-side the iPhone blows away the S5 in terms of app switching, downloads, app installs, and … well… just about everything.  Hell, the S5 takes 4-5 seconds to start up the camera app and snap the photo  (the new faster Google Camera app is so buggy it hangs 80% of the time but in the 20% of the time it works still takes 3 seconds to start).   The iPhone 6S Plus…  it is instantaneous.   The 6S is so fast in bringing up the camera tt is even faster than my actual pocket camera that has to open the lens cover (about 1 second or less). And in case 1/1000th of a second isn’t fast enough this camera uses some vodoo black magic to capture a second or two of photos BEFORE you clicked the take-photo button. What!?!?
Intangible “feel”.   Don’t get me wrong, the Galaxy S5 feels solid.   However the feel of quality when holding the phone is just “better”.  More solid.   It is hard to quantify by the 6S Plus feels like a solid piece of milled aluminum and the S5 feels like a piece of solid milled aluminum with some plastic tacked on that should really be there.   
The Other Stuff.  The “just touch me” fingerprint scanner blows away the S5 “swipe me and I might recognize it but likely won’t” scanner.   There are FAR MORE quality accessories both from Apple and 3rd parties for the iPhones 6S; which is amazing as it has been out for 60 days versus 18 months.   Compatibility with 3rd party devices; again EVERYTHING works with and usually works-better-with the iPhone which is NOT true of the leading Android Galaxy S5.  No extra pre-installed crap like the dozen-plus bloated apps Samsung forces you to have (and can never delete BTW, without voiding the warranty) so that Samsung can lower their price into your hands.
 

Android beats iPhone

The Back Button.   Seriously, why doesn’t Apple steal this idea.   It saves SOOOO much time over having to scroll to the top of an app just to back up.    I didn’t realize it but that is a HUGE time saver.
Integration with Google services.  We all know this is on purpose and it all at the hands of Google.    However getting all of my primary business connectivity via email, hangouts and every-other-app is the ONLY thing that was not a “oh, it just configures itself” on the iPhone.  On android it is kind of a pain especially if you have 2-factor authentication but on iPhone it seems to NEVER work until literally the 4th setup attempt (I swear Google has a counter that has to be reached before it will work).
App-to-app integration.   Some third party apps, like LastPass for example, work far better with other apps on Android.  On Apple they have put everything  under such tight controls that apps from different vendors don’t tend to like to talk to each other.
Speaker Quality.   The external speaker, the one you use to watch videos or to to a “speaker call” is absolutely ridiculous on the iPhone.  And I mean ridiculous in the “what fucktard came up with this” type of ridiculous not in a “that party was RIDICULOUS” as in an epic sort of way.     That iPhone speaker is placed perfectly so that if you don’t contort your hand into some fucked-up “I’m the direct offspring of quasimodo” sort of grip you will effectively mute the sound entirely.    Yeah, I get it, the sound is great if you lie it down on a desk.  But for those of you that actually HOLD your phone… it is completely freakin’ useless.  How did Apple miss this mark so badly?

Which Is Better?

So which do I like better at the moment? Well, not having a ubiquitous back-button is really annoying. It is amazing how many screen presses that saves you. Also the speaker placement on a $900 phone should NOT be in a place that completely MUTES the phone if you don’t hold it just right. Really? Yup, really.
 
That said, the most important things to me are battery life, camera and video quality, not having to delete all my photos just to update an app, and a phone that leverages ALL the features of my tech life (car, home security, home sound systems, and all my gadgets). Despite the ridiculous speaker placement and lack of a back button, the iPhone is already killing it in the 4 primary things I am looking for.
Luckily there are nearly one-bazillion third party accessories out there for the iPhone 6S Plus just 30 days after launch that I can certainly find a stand that lets me watch videos AND hear them at the same time without having to hold the phone.
Now if this thing doesn’t factory reset within the first 60 days I think I’ve found a new favorite tech toy.
%d bloggers like this: