Kaare
Kaare

Reputation: 531

How to use GIT on linux server with limited rights

I want to use git to transfer code between my account on a cluster and my work computer.

The cluster already has a git installation, but I can't get it to clone? The recommendation seems to be to use https, and a good first step seems to be to try to update git?

git clone https://github.com/git/git
Cloning into 'git'...
fatal: unable to access 'https://github.com/git/git/': error setting certificate verify locations:
  CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none

As I understand it, git is trying to write to a .crt file, but can't? I suspect an issue could be that I don't have write access to /etc/ssl/certs? if so, what is the workaround?

For reference, in case this info is important:

git --version
git version 1.8.3.1

cd /etc/ssl/certs
ls
ca-bundle.crt  ca-bundle.trust.crt  make-dummy-cert  Makefile  renew-dummy-cert

I hope the question makes sense.

Upvotes: 0

Views: 229

Answers (1)

acran
acran

Reputation: 9018

/etc/ contains system wide configurations and /etc/ssl/ even quite sensitive ones. So it is absolute correct that you can not write there as a non-root user and git also won't try to write there. git should work as ordinary user just fine.

The error message however indicates that git is trying to read /etc/ssl/certs/ca-certificates.crt for trusted CA certificates to verify the HTTPS connection is secure. But on your system this file does not exist, instead there is a /etc/ssl/certs/ca-bundle.crt that git should probably use instead. So this seems to be a configuration error.

You can manually specify the path to the CA info file with the http.sslCAInfo configuration option:

git -c http.sslCAInfo=/etc/ssl/certs/ca-bundle.crt clone https://github.com/git/git

# or set the path in your global ~/.gitconfig
git config --global http.sslCAInfo /etc/ssl/certs/ca-bundle.crt
git clone https://github.com/git/git

If this still won't work you can disable ssl verification completely with http.sslVerify=false - but this is a security risk! Only do this if you know what you're doing and manually verifying the integrity of the cloned code.

Upvotes: 1

Related Questions