Reputation: 301
Is it possible to secure my GIT repository using a password? e.g. when I clone the repository, I want to get prompted to enter an password otherwise, I cannot clone it.
I am using a GIT repository in my local area network and I often clone repositories from the server onto my local PC. I am concerned that anybody in the network can clone the repository and access confidential source code.
Upvotes: 1
Views: 974
Reputation: 4306
You're likely running the Git daemon, which offers no encryption or authentication. This is only ideal for public read-only mirrors of your repositories.
For a closed network, using HTTP and HTTPS instead of the Git daemon will provide a slight performance increase, plus firewall penetration and proxy support. HTTPS requires a trusted TLS certificate and additional configuration.
The most secure method is to use SSH, which provides strong encryption and both password and key authentication.
Learn More and see these instructions for setting up an SSH git server.
Upvotes: 1