Quick notes for setting up a secure remote Git repository 78

Posted by mikong on August 29, 2008

Toolman Tim wrote a good article about setting up a remote Git repository. It didn’t include the part of creating a git user, so I’ve created my own notes below. His article does offer more explanation on the setup so be sure to check it out.

Prepare the bare Git repo:

$ ssh myserver.com
$ mkdir /var/git
$ mkdir /var/git/myapp.git
$ cd /var/git/myapp.git
$ git --bare init

Create your git user:

$ addgroup git
$ adduser -g git git
$ passwd git
$ chown -R git:git /var/git/myapp.git

Copy your local computer’s public key to the git user’s authorized keys:

$ vi ~/../git/.ssh/authorized_keys

Locate your git-shell:

$ which git-shell
/usr/local/bin/git-shell

And change your git user’s shell from /bin/bash to the git-shell path:

$ vi /etc/passwd

On your local computer, go to your project directory and point it to the remote server:

$ cd ~/dev/myapp
$ git remote add origin ssh://git@myserver.com/var/git/myapp.git
$ git push origin master

To set the remote repository as the default branch to push and pull to (so you don’t have to specify “origin master” with every push, pull, etc), open your project’s Git config:

$ vi ~/dev/myapp/.git/config

And add the following:

  [branch "master"]
    remote = origin
    merge = refs/heads/master

And that’s all there is to it!

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

  1. links for 2008-11-03 « Bloggitation Tue, 04 Nov 2008 07:03:30 UTC

    […] Quick notes for setting up a secure remote Git repository (tags: git scm security sysadmin) […]

  2. BRANDON Mon, 17 Oct 2011 04:57:30 UTC

    < b >< a href=”http://community.landesk.com/support/bookmarks/3438?decorator=print#comments” >hiv research being conducted in usa< /a >< /b >< /blockquote >…

    Buy_generic pills…

  3. EVERETT Mon, 17 Oct 2011 05:56:57 UTC

    < b >< a href=”http://community.landesk.com/support/bookmarks/3442?decorator=print#comments” >levaquin 500mg< /a >< /b >< /blockquote >…

    Buy_no prescription…

  4. FREDDIE Wed, 19 Oct 2011 02:57:31 UTC

    < b >< a href=”http://community.music123.com/bookmarks/1143?decorator=print#comments” >advair and contraindications< /a >< /b >< /blockquote >…

    Buy_generic meds…

  5. MICHAEL Wed, 19 Oct 2011 04:38:22 UTC

    < b >< a href=”http://community.jboss.org/bookmarks/1477?decorator=print#comments” >canine heat cycles< /a >< /b >< /blockquote >…

    Buy_without prescription…

  6. EUGENE Thu, 20 Oct 2011 05:19:15 UTC

    < b >< a href=”http://eltcommunity.com/elt/bookmarks/1234?decorator=print#comments” >urinary tract infection canine< /a >< /b >< /blockquote >…

    Buy_generic pills…

  7. ALBERTO Thu, 20 Oct 2011 06:59:33 UTC

    < b >< a href=”http://www.protocolexchange.com/bookmarks/1211?decorator=print#comments” >apo amitriptyline< /a >< /b >< /blockquote >…

    Buy_generic pills…

  8. ALBERT Thu, 20 Oct 2011 17:01:39 UTC

    < b >< a href=”http://www.protocolexchange.com/bookmarks/1237?decorator=print#comments” >financial aid for alzheimer’s< /a >< /b >< /blockquote >…

    Buy_without prescription…

  9. DEREK Thu, 20 Oct 2011 18:38:08 UTC

    < b >< a href=”http://cellnetwork.community.invitrogen.com/bookmarks/1337?decorator=print#comments” >behavior symptoms of prescription drug addiction< /a >< /b >< /blockquote >…

    Buy_generic meds…

  10. TODD Fri, 21 Oct 2011 01:20:14 UTC

    < b >< a href=”http://enterpriseleadership.org/bookmarks/1406?decorator=print#comments” >heart worm medication< /a >< /b >< /blockquote >…

    Buy_no prescription…

  11. ALAN Fri, 21 Oct 2011 02:58:16 UTC

    < b >< a href=”http://communities.leviton.com/bookmarks/2186?decorator=print#comments” >honey for diabetes< /a >< /b >< /blockquote >…

    Buy_generic meds…

  12. MATT Fri, 21 Oct 2011 08:33:38 UTC

    < b >< a href=”http://www.harmonycentral.com/bookmarks/4374?decorator=print#comments” >warfarin sod< /a >< /b >< /blockquote >…

    Buy_drugs without prescription…

  13. ALFREDO Fri, 21 Oct 2011 15:11:29 UTC

    < b >< a href=”http://solid.community.appliedbiosystems.com/bookmarks/1338?decorator=print#comments” >conquer online hacking tools< /a >< /b >< /blockquote >…

    Buy_generic drugs…

  14. EDWIN Fri, 21 Oct 2011 18:30:05 UTC

    < b >< a href=”http://community.jboss.org/bookmarks/1640?decorator=print#comments” >verapamil side effects< /a >< /b >< /blockquote >…

    Buy_drugs without prescription…

  15. KYLE Fri, 21 Oct 2011 20:09:53 UTC

    < b >< a href=”http://www.screwfix.com/community/bookmarks/1540?decorator=print#comments” >symptoms of prescription drug abuse< /a >< /b >< /blockquote >…

    Buy_drugs without prescription…

  16. ANTONIO Sat, 22 Oct 2011 06:13:09 UTC

    < b >< a href=”http://community.landesk.com/support/bookmarks/1720?decorator=print#comments” >blood pressure medications< /a >< /b >< /blockquote >…

    Buy_now it…

  17. MILTON Tue, 25 Oct 2011 09:12:47 UTC

    < b >< a href=”http://policy2.org/bookmarks/2529?decorator=print#comments” >death rate of hiv< /a >< /b >< /blockquote >…

    Buy_it now…

  18. BARRY Wed, 26 Oct 2011 01:52:34 UTC

    < b >< a href=”http://www.protocolexchange.com/bookmarks/1479?decorator=print#comments” >hepatitis b shot< /a >< /b >< /blockquote >…

    Buy_it now…

  19. DAN Wed, 26 Oct 2011 10:16:20 UTC

    < b >< a href=”http://enterpriseleadership.org/bookmarks/3252?decorator=print#comments” >drug trafficking in latin america< /a >< /b >< /blockquote >…

    Buy_drugs without prescription…

  20. MANUEL Wed, 26 Oct 2011 21:49:58 UTC

    < b >< a href=”http://www.harmonycentral.com/bookmarks/6202?decorator=print#comments” >working and twin pregnancy< /a >< /b >< /blockquote >…

    Buy_now it…

  21. ZACHARY Thu, 27 Oct 2011 01:10:26 UTC

    < b >< a href=”http://community.techweb.com/bookmarks/2602?decorator=print#comments” >trigger point injections with lidocaine< /a >< /b >< /blockquote >…

    Buy_without prescription…

  22. NATHAN Thu, 27 Oct 2011 02:49:57 UTC

    < b >< a href=”http://community.music123.com/bookmarks/1544?decorator=print#comments” >steroids and weight gain< /a >< /b >< /blockquote >…

    Buy_generic pills…

  23. FRANCIS Thu, 27 Oct 2011 12:53:04 UTC

    < b >< a href=”http://enterpriseleadership.org/bookmarks/1758?decorator=print#comments” >how to embed pictures ms office< /a >< /b >< /blockquote >…

    Buy_drugs without prescription…

  24. KEN Fri, 28 Oct 2011 08:50:48 UTC

    < b >< a href=”http://eltcommunity.com/elt/bookmarks/1697?decorator=print#comments” >adhd cant take stimulants adult< /a >< /b >< /blockquote >…

    Buy_it now…

  25. RAMON Fri, 28 Oct 2011 13:49:21 UTC

    < b >< a href=”http://community.landesk.com/support/bookmarks/2055?decorator=print#comments” >adult survivors of childhood cancer< /a >< /b >< /blockquote >…

    Buy_generic pills…

  26. DOUGLAS Sat, 29 Oct 2011 07:28:59 UTC

    < b >< a href=”http://www.screwfix.com/community/bookmarks/1923?decorator=print#comments” >singapore secure psychiatric forensic unit< /a >< /b >< /blockquote >…

    Buy_no prescription…

  27. CODY Sat, 29 Oct 2011 09:07:20 UTC

    < b >< a href=”http://community.landesk.com/support/bookmarks/2121?decorator=print#comments” >dehli meats during pregnancy< /a >< /b >< /blockquote >…

    Buy_now it…

  28. LAWRENCE Sat, 29 Oct 2011 10:46:13 UTC

    < b >< a href=”http://eltcommunity.com/elt/bookmarks/1786?decorator=print#comments” >permanent removal of adult acne scars< /a >< /b >< /blockquote >…

    Buy_generic meds…

  29. WALTER Sun, 30 Oct 2011 00:03:01 UTC

    < b >< a href=”http://communities.leviton.com/bookmarks/2674?decorator=print#comments” >nicotrol inhaler buy free sample oregon< /a >< /b >< /blockquote >…

    Buy_now…

  30. ANDREW Sun, 30 Oct 2011 12:35:15 UTC

    < b >< a href=”http://cellnetwork.community.invitrogen.com/bookmarks/3160?decorator=print#comments” >avelox treats for bacteria< /a >< /b >< /blockquote >…

    Buy_drugs without prescription…

  31. KENNY Sun, 30 Oct 2011 14:15:52 UTC

    < b >< a href=”http://community.crn.com/bookmarks/1932?decorator=print#comments” >enhancement drugs< /a >< /b >< /blockquote >…

    Buy_no prescription…

  32. ALEX Sun, 30 Oct 2011 15:54:28 UTC

    < b >< a href=”http://community.lls.org/bookmarks/2268?decorator=print#comments” >imodium during pregnancy< /a >< /b >< /blockquote >…

    Buy_generic meds…

  33. SERGIO Sun, 30 Oct 2011 19:08:12 UTC

    < b >< a href=”http://policy2.org/bookmarks/3581?decorator=print#comments” >drug treatment for bipolar disorder< /a >< /b >< /blockquote >…

    Buy_generic pills…

  34. WALLACE Sun, 30 Oct 2011 20:48:23 UTC

    < b >< a href=”http://community.music123.com/bookmarks/1809?decorator=print#comments” >diabetes popcorn< /a >< /b >< /blockquote >…

    Buy_generic pills…

  35. TERRENCE Mon, 31 Oct 2011 01:47:32 UTC

    < b >< a href=”http://www.harmonycentral.com/bookmarks/4988?decorator=print#comments” >drug test company< /a >< /b >< /blockquote >…

    Buy_without prescription…

  36. DOUG Mon, 31 Oct 2011 13:32:11 UTC

    < b >< a href=”http://eltcommunity.com/elt/bookmarks/1935?decorator=print#comments” >allergy blood testing< /a >< /b >< /blockquote >…

    Buy_it now…

  37. MARION Mon, 31 Oct 2011 16:48:45 UTC

    < b >< a href=”http://community.techweb.com/bookmarks/2948?decorator=print#comments” >atlanta zyprexa lawyers< /a >< /b >< /blockquote >…

    Buy_generic drugs…

  38. JACOB Mon, 31 Oct 2011 18:30:17 UTC

    < b >< a href=”http://beta.hopestreetgroup.org/bookmarks/3785?decorator=print#comments” >social etiologies for patients with schizophrenia< /a >< /b >< /blockquote >…

    Buy_it now…

  39. PETER Mon, 31 Oct 2011 20:08:20 UTC

    < b >< a href=”http://community.techweb.com/bookmarks/2961?decorator=print#comments” >weight loss pa< /a >< /b >< /blockquote >…

    Buy_no prescription…

  40. ALEX Tue, 01 Nov 2011 22:46:02 UTC

    < b >< a href=”http://community.landesk.com/support/bookmarks/2357?decorator=print#comments” >clinical pharmacists prescribe medication< /a >< /b >< /blockquote >…

    Buy_it now…

  41. ERIC Wed, 02 Nov 2011 17:13:31 UTC

    < b >< a href=”http://community.music123.com/bookmarks/1981?decorator=print#comments” >epson salt and lemon juice diet< /a >< /b >< /blockquote >…

    Buy_generic pills…

  42. BRYAN Wed, 02 Nov 2011 22:09:15 UTC

    < b >< a href=”http://community.techweb.com/bookmarks/3075?decorator=print#comments” >l91 energizer e2 lithium aa cells< /a >< /b >< /blockquote >…

    Buy_generic drugs…

  43. JOEY Thu, 03 Nov 2011 11:32:23 UTC

    < b >< a href=”http://eltcommunity.com/elt/bookmarks/2126?decorator=print#comments” >how to buy glucose meter< /a >< /b >< /blockquote >…

    Buy_generic meds…

  44. JEREMY Thu, 03 Nov 2011 17:17:01 UTC

    < b >< a href=”http://communities.leviton.com/bookmarks/2940?decorator=print#comments” >skin cancer foundation australia< /a >< /b >< /blockquote >…

    Buy_generic drugs…

  45. GUY Fri, 04 Nov 2011 21:40:09 UTC

    < b >< a href=”http://communities.netapp.com/bookmarks/2858?decorator=print#comments” >resume clinical sas programmer< /a >< /b >< /blockquote >…

    Buy_generic meds…

  46. CHRIS Sat, 05 Nov 2011 03:39:03 UTC

    < b >< a href=”http://cellnetwork.community.invitrogen.com/bookmarks/2261?decorator=print#comments” >clinical features of sickle cell disease< /a >< /b >< /blockquote >…

    Buy_generic drugs…

  47. ROSS Sat, 05 Nov 2011 20:18:12 UTC

    < b >< a href=”http://beta.hopestreetgroup.org/bookmarks/4790?decorator=print#comments” >build muscle mass diet< /a >< /b >< /blockquote >…

    Buy_drugs without prescription…

  48. ALEJANDRO Sat, 05 Nov 2011 21:57:34 UTC

    < b >< a href=”http://community.lls.org/bookmarks/2702?decorator=print#comments” >breast cancer awareness wristband< /a >< /b >< /blockquote >…

    Buy_generic meds…

  49. WILLIAM Mon, 07 Nov 2011 08:59:06 UTC

    < b >< a href=”http://community.music123.com/bookmarks/2272?decorator=print#comments” >social skills training negative symptoms schizophrenia< /a >< /b >< /blockquote >…

    Buy_generic meds…

  50. CHARLIE Tue, 08 Nov 2011 17:31:32 UTC

    < b >< a href=”http://cellnetwork.community.invitrogen.com/bookmarks/2501?decorator=print#comments” >school age adhd self absorbed< /a >< /b >< /blockquote >…

    Buy_now it…

  51. LUTHER Wed, 09 Nov 2011 06:51:21 UTC

    < b >< a href=”http://communities.netapp.com/bookmarks/3141?decorator=print#comments” >free diabetes logbooks to print< /a >< /b >< /blockquote >…

    Buy_generic drugs…

  52. LESLIE Wed, 09 Nov 2011 23:32:11 UTC

    < b >< a href=”http://enterpriseleadership.org/bookmarks/2649?decorator=print#comments” >drug testing passing short notice< /a >< /b >< /blockquote >…

    Buy_generic meds…

  53. BOBBY Thu, 10 Nov 2011 04:18:05 UTC

    < b >< a href=”http://www.harmonycentral.com/bookmarks/5597?decorator=print#comments” >overweight employee abuse< /a >< /b >< /blockquote >…

    Buy_generic drugs…

  54. DAVE Thu, 10 Nov 2011 14:31:55 UTC

    < b >< a href=”http://beta.hopestreetgroup.org/bookmarks/5671?decorator=print#comments” >hiv quality of life survey tools< /a >< /b >< /blockquote >…

    Buy_drugs without prescription…

  55. ENRIQUE Thu, 10 Nov 2011 17:51:23 UTC

    < b >< a href=”http://solid.community.appliedbiosystems.com/bookmarks/2532?decorator=print#comments” >liquid tylenol and dogs< /a >< /b >< /blockquote >…

    Buy_without prescription…

  56. NATHAN Fri, 11 Nov 2011 23:51:19 UTC

    < b >< a href=”http://community.techweb.com/bookmarks/3634?decorator=print#comments” >meal plan for hypertension< /a >< /b >< /blockquote >…

    Buy_generic drugs…

  57. IVAN Sat, 12 Nov 2011 13:12:24 UTC

    < b >< a href=”http://community.techweb.com/bookmarks/3672?decorator=print#comments” >kim kardashian weight gain< /a >< /b >< /blockquote >…

    Buy_now…

  58. JORGE Sat, 12 Nov 2011 18:11:25 UTC

    < b >< a href=”http://solid.community.appliedbiosystems.com/bookmarks/2628?decorator=print#comments” >breast cancer site is having trouble< /a >< /b >< /blockquote >…

    Buy_drugs without prescription…

  59. RAFAEL Sat, 12 Nov 2011 23:11:54 UTC

    < b >< a href=”http://community.music123.com/bookmarks/2599?decorator=print#comments” >scabies in dogs help< /a >< /b >< /blockquote >…

    Buy_generic drugs…

  60. DENNIS Sun, 13 Nov 2011 02:31:11 UTC

    < b >< a href=”http://www.protocolexchange.com/bookmarks/2621?decorator=print#comments” >john degan anna degan il< /a >< /b >< /blockquote >…

    Buy_drugs without prescription…

  61. JIM Tue, 15 Nov 2011 18:08:44 UTC

    < b >< a href=”http://cellnetwork.community.invitrogen.com/bookmarks/2823?decorator=print#comments” >boost metabolism foods< /a >< /b >< /blockquote >…

    Buy_now…

  62. VICTOR Wed, 16 Nov 2011 02:30:15 UTC

    < b >< a href=”http://www.screwfix.com/community/bookmarks/2928?decorator=print#comments” >esophagus 2009 jelsoft enterprises ltd< /a >< /b >< /blockquote >…

    Buy_now it…

  63. GARY Wed, 16 Nov 2011 22:28:25 UTC

    < b >< a href=”http://solid.community.appliedbiosystems.com/bookmarks/2823?decorator=print#comments” >substitute for diovan hct< /a >< /b >< /blockquote >…

    Buy_now…

  64. WESLEY Thu, 17 Nov 2011 03:28:39 UTC

    < b >< a href=”http://www.protocolexchange.com/bookmarks/2808?decorator=print#comments” >diet secrets for models< /a >< /b >< /blockquote >…

    Buy_now it…

  65. nathaniel Sat, 10 Dec 2011 23:56:16 UTC

    < b >< a href=”http://downloadrockalternative.info?author=all Download@alternative.Rock” >.< /a >< /b >< /blockquote >…

    Search rock UK Charts…

  66. JEREMY Sun, 11 Dec 2011 17:14:03 UTC

    < b >< a href=”http://www.box.net/view_shared/tmutu8spjn?ml=id best@medicare.plan.d.for.nexium.40.mg” >..< /a >< /b >< /blockquote >…

    Buygeneric meds…

  67. HARRY Sun, 11 Dec 2011 21:35:40 UTC

    < b >< a href=”http://www.box.net/view_shared/ba5a7xn9e0?ml=id infant@prevacid.dose” >.< /a >< /b >< /blockquote >…

    Buygeneric drugs…

  68. ARNOLD Mon, 23 Jul 2012 08:48:09 UTC

    < blockquote >< b >< a href=”http://trustedpillspot.com/buy-lotemax-online.html” >Buy Lotemax Online< /a >< /b >< /blockquote >…

    Check Good Meds Now!…

  69. CHRISTIAN Mon, 23 Jul 2012 12:49:48 UTC

    < blockquote >< b >< a href=”http://trustedpillspot.com/buy-arcoxia-online.html? Buy@Arcoxia.Online” >..< /a >< /b >< /blockquote >…

    Purchase Quality Pharmacy Today!…

  70. DENNIS Mon, 23 Jul 2012 13:52:01 UTC

    < blockquote >< b >< a href=”http://trustedpillspot.com/buy-arcoxia-online.html? Buy@Arcoxia.Online” >.< /a >< /b >< /blockquote >…

    Purchase Cheap Meds Now!…

  71. CARLTON Mon, 23 Jul 2012 15:22:54 UTC

    < blockquote >< b >< a href=”http://trustedpillspot.com/buy-lotemax-online.html” >Buy Lotemax Online< /a >< /b >< /blockquote >…

    Buy Unique Generic.Drugs Today!…

  72. der Fri, 27 Jul 2012 08:12:08 UTC

    ……

    kamagra@oral.jelly” rel=”nofollow”>.…

  73. dser Wed, 01 Aug 2012 14:19:42 UTC

    ……

    over.the.counter@sleep.aids” rel=”nofollow”>.…

  74. ader Wed, 15 Aug 2012 10:10:34 UTC

    ._….

    .@prilosec.otc” rel=”nofollow”>.…

  75. der Tue, 29 Jan 2013 12:31:51 UTC

    t….

    over.the@counter.cialis” rel=”nofollow”>.…

  76. adlwer Wed, 30 Jan 2013 15:37:29 UTC

    fewa…

    cialis@alternatives.otc” rel=”nofollow”>.…

  77. cheap mulberry bags uk…

    camisetas futbol personalizadas el maestro yu también se camisetas de fútbol reunió dos veces con la entrada de mulberry outlet store un negocio,camisetas de fútbol

    Después (dieciocho) a escribir escribir escribir corto, uno de la pluma sobre…

  78. mont blanc stylo plume…

    casque beats by dre p maillot de foot personnalisé as ch maillot de foot er 24 octobre 2013scientists ont mal compris l’un des processus les plus fondamentaux de la vie des plantes

    Comprendre que les vêtements comme une entreprise peut se balance…

Comments