Run a Secure git Repository on FreeNAS

Running a secure git repository on FreeNAS is pretty straight forward, once you understand what your trying to do.  If you have looked over my previous post “Creating a secure Git repository server” you understand that all you really need to do is connect to the git repository via ssh/ssl and copy back what you need.  The hardest part of using FreeNAS is creating the keys.

To start out, you need to create a user account on the FreeNAS system.  This will be a generic account that everyone who has write access will use.  You may also create a account for each person, and grant each of them access to the central repository.

After you have your account, follow my post on “Enable SSH Key Authorization on FreeNAS” to copy over the SSL key and setup the account.  Once you are able to log in as your FreeNAS git user, you may follow my previous post “Creating a secure Git repository server” to setup the git repository.

4 thoughts on “Run a Secure git Repository on FreeNAS

  1. Really nice posts concerning git.

    But there is one question left for me. How did you installed git on your freenas server? Where did you get the package and did you have to resolve dependencies?

    Thank you,
    Hani

    • The wonderful part of git, it that it’s not installed on the server. No part of the git program is installed on my FreeNAS box, just the repository was copied over. I’m using SSH and Apache to communicate with the repository alone, nothing else. :)

  2. Hi Matt
    I have followed your ‘Creating a secure Git repository server’ and I am using FreeNAS.
    As git is not installed on my FreeNAS server, I had to use git on my local system to actually initialize the repo on the FreeNAS:

    cd /y/vol1/git/gitusers <-- /y is my local mount-point
    mkdir testgit
    cd testgit
    git init --bare

    Trying to do:
    git push origin master

    results in the following printout:
    $ git push origin master
    git@192.168.200.9's password: <-- I entered git user passwd (works with ssh)
    git-receive-pack: not found
    fatal: The remote end hung up unexpectedly

    Looking at our example on how to init remote repo, it seems like you are logged in on remote system and thus need git installed on remote system.

    regards

    ole

    • To create the remote repo, just create it on your local system, using the –bare flag, and copy the folder to your freenas system. But make sure your not creating the local repo with the –bare flag.

      -Matt

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>