3

I would like to use my Raspberry Pi 2 mainly as a media center but also as a private git server for small projects like LaTeX documents.

My goal is to be able to set this server as a remote repo to push to and pull from over the web with various interfaces (Linux shell, Windows Git-tortoise). On the other hand, I would like to prevent unauthenticated access to my home network and my Pi.

Since there are multiple ways of achieving this and I am not an expert regarding IT security, I would like to know if someone can recommend or has experience with a certain setup:

My first idea was to enable port-forwarding inside my router for SSH access to the Pi. This seems to work, however, I would have to change the default username and password, or anyone would be able to access the device. I would also have to create a new (somehow restricted) user account if I ever wanted to share the repo.

What other possibilities are there to achieve this functionality?

  • Welcome -- but this is a Q&A site, not a discussion forum. Very broad and/or open ended questions such as this one are not appropriate. Please take the tour if you have not yet. Singular, specific questions are fine, but you have a series of arbitrary ones, some of which (e.g., the capabilities of apache) are not pi-specific and hence off-topic here. And yes, if you want to run a git server, you must install git server software. – goldilocks Jan 24 '16 at 15:14
  • I tried to narrow it down a bit, if it's still too broad, I will adressthe question to a different platform, no problem. – Niclas Jan 24 '16 at 15:46
  • "Git server" is a misnomer - git is a distributed SCM and the contents of a repository are peer-shared/duplicated amongst all users - all it takes is a user, called perhaps "git" but that is not important with an account on the RPi and ssh access to it . I keep a bare "mirror" repository (no local editable files, just the .git subdirectory) on a spare Laptop that I use for other things such as a IPv6 gateway. I then push changes from my development machines out to it and fetch updates from it using the native git "ssh" handlers. – SlySven Jan 24 '16 at 19:17
  • You are most likely right, when I wrote "git server", I meant it as "Server containing a remote bare git repository", which is about the same terminology used in the official documentation. But using your method would give full SSH control over the device to everyone interacting with this repository, while I would rather limit it to pushing und pulling. – Niclas Jan 24 '16 at 23:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.