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.

Advertisements

11 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

  3. Hi Matt,

    Thanks for your help but I do can not make it work and I think that is not possible.

    The instructions that you sent me are to force git to set the path of the binaries in the remote server (because bashrc is ignore through ssh commanding)… But if you don’t have the binaries installed in the remote server there is no way to go.

    I tried both things without success and I found a simpler one, but getting the same result:

    git clone -u /usr/local/git/bin/git-upload-pack ssh://user@xx.xx.xx.xx/test test2


    /usr/local/git/bin/git-upload-pack: No such file or directory

    As soon as you put the binaries in the remote machin (the one acting as server) in any path but specified within this command all goes flawlessly. Do you have any other idea?

    Cheers and thanks again

  4. Pingback: Using FreeNAS With VirtualBox To Create A True Personal Storage Cloud? | EssayBoard

  5. Pingback: Configuring FreeNAS To Host Time Machine Volume, Allowing Mac Users To Backup Data Across Network Using Time Machine | EssayBoard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s