Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

LFS via ssh

Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 18, 2018

Hi there,

For security reasons we have disabled https cloning from our Bitbucket instance. (Admin > Server Settings > HTTP(S) SCM hosting > HTTP(S) enabled > off)

Is it possible to use LFS via ssh? And if so, how can we do this?

 

Regards

Rudy

3 answers

1 accepted

2 votes
Answer accepted
jredmond
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 19, 2018

This is not currently possible - the git-lfs extension is built around HTTP.

Reference:

The Git LFS client uses an HTTPS server to coordinate fetching and storing large binary objects separately from a Git server.

(from https://github.com/git-lfs/git-lfs/tree/master/docs/api)

0 votes
Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 18, 2018

Sorry I was not completely clear, we use Bitbucket server, not Cloud.

I'm getting the following error message:

>git push
Git LFS: (0 of 1 files) 0 B / 128.45 KB
batch response: Unable to parse HTTP response for POST https://mybitbucket/scm/project/test-lfs.git/info/lfs/objects/batch: invalid character '\n' in string literal
error: failed to push some refs to 'ssh://git@mybitbucket:7999/project/test-lfs.git'

When I enable https on the server, it does work. But for security reasons we may only interact with git with ssh

Edwin Kyalangalilwa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2018

Please check the git remote url. Is it pointing to HTTPS?

Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 18, 2018

I clone with ssh, so no my remote is pointing to ssh.

Here are my settings:

>git remote -vv
origin ssh://git@mybitbucket:7999/project/test-lfs.git (fetch)
origin ssh://git@mybitbucket:7999/project/test-lfs.git (push)
>git lfs env
git-lfs/2.3.4 (GitHub; windows amd64; go 1.8.3; git d2f6752f)
git version 2.15.1.windows.2

Endpoint=https://mybitbucket/project/test-lfs.git/info/lfs (auth=basic)
SSH=git@mybitbucket:project/test-lfs.git
LocalWorkingDir=C:\Users\me\test-lfs
LocalGitDir=C:\Users\me\test-lfs\.git
LocalGitStorageDir=C:\Users\me\test-lfs\.git
LocalMediaDir=C:\Users\me\test-lfs\.git\lfs\objects
LocalReferenceDir=
TempDir=C:\Users\me\test-lfs\.git\lfs\tmp
ConcurrentTransfers=3
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=C:\Users\me\test-lfs\.git\lfs
AccessDownload=basic
AccessUpload=basic
DownloadTransfers=basic
UploadTransfers=basic
GIT_LFS_PATH=C:\Program Files\Git LFS
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"
Ravi GH July 11, 2018

The Git LFS  uses HTTP Basic Authentication to authorize requests.

0 votes
Edwin Kyalangalilwa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2018

Hi Rudy,

Yes, it is possible. After SSH keys have been setup.

git clone git@bitbucket.org:test/repo.git
git lfs clone git@bitbucket.org:test/repo.git
Kiwi July 10, 2023

Correct. For anyone looking at this for information, git lfs does now support authentication over ssh.

git-lfs/docs/api/server-discovery.md at main · git-lfs/git-lfs · GitHub

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events