LFS repeat logon?

I'm getting prompted to authenticate repeatedly when cloning a repo with LFS managed content - one password prompt for each LFS managed file in the repo.  I'm guessing that this is because the LFS managed files are via SSH and the rest are via HTTP(S).

Any way to prevent multiple prompts? Makes this pretty useless for automated purposes (build, deploy etc) otherwise.

2 answers

1 accepted

3 votes

Hi @David X Johnson,

for LFS it is recommended to use Git's Credential Storage caching. This means that you'll only need to enter your credentials once. 

You can set credential caching in your git config by running the following command: 

git config --global credential.helper cache

I hope that helps, 

Felix

Thank you, this was the solution I was looking for.

2 votes

Hi David,

This is a common question and relates to how the client is implemented as a Git filter, see: https://github.com/github/git-lfs/issues/858

During clone, the git filter is invoked once per LFS file, which is likely why you are seeing a password (or SSH passphrase) request for each file.

The recommendation is to setup a credentials cacher. Your question seems to indicate you are using an SSH remote, and while it is true that the actual LFS traffic will be via HTTP/HTTPS what you actually need is something like ssh-agent to cache your SSH passphrase. The configuration of such a cache will vary depending on your operating system.

The authentication process is different for SSH vs HTTP remotes:

SSH Remotes: When an SSH remote is used Bitbucket Server will respond to the git-lfs-authenticate command and will supply an authentication token that the Git LFS client will then be used to access the Git LFS API via HTTP/HTTPS. In this case you will be prompted for your SSH key passphrase.

HTTP/S Remotes: When a HTTP/S remote is used the client making a request of Bitbucket Server will be required to provide a username and password for basic auth.

Hope this helps.

Regards,
Ben 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,785 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you