{"id":691,"date":"2019-05-24T03:03:43","date_gmt":"2019-05-24T10:03:43","guid":{"rendered":"https:\/\/doubleecpu.com\/?page_id=691"},"modified":"2019-06-08T15:32:44","modified_gmt":"2019-06-08T22:32:44","slug":"gitolite","status":"publish","type":"page","link":"https:\/\/doubleecpu.com\/index.php\/raspian-linux-programs\/gitolite\/","title":{"rendered":"Gitolite"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Setup Secure SSH Connection<\/h3>\n\n\n\n<p>Generate SSH key using the remote workstation then secure copy to RaspberryPi<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh-keygen -t rsa -b 4096 -C \"remoteuser\"<\/pre>\n\n\n\n<p>enter file path and name to save or press enter to use default (\/home\/pi\/.ssh\/id_rsa): pi <br>This should create 2 filesthat will contain private and public keys. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd .ssh\nscp pi.pub pi@[RaspberryPi]:\/home\/pi\/pi.pub <\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" style=\"text-align:left\">check version of Git &amp; Install gitolite<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">git --version \nsudo apt-get install git-core gitolite3<\/pre>\n\n\n\n<p>Add the SSH key generated to gitolite<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"657\" height=\"418\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2019\/06\/gitolite_adminSSHKEY.png\" alt=\"\" class=\"wp-image-715\"\/><\/figure>\n\n\n\n<p>Add user ssh keys to the lists<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">gitolite3 setup -pk  \/home\/pi\/pi.pub <\/pre>\n\n\n\n<p>The file should be added to the list \/var\/lib\/gitolite\/.ssh\/authorized_keys<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">To add New User to Raspberry Pi<\/h3>\n\n\n\n<p>Add new user(s) fill in password, full name, room number, work phone, home phone, other and confirm it is correct. Then add group <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo adduser [remoteuser] \nsudo addgroup developers<\/pre>\n\n\n\n<p>add [remoteuser] user to the developers group. <br>Validate using: groups  [remoteuser] <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo usermod -a -G developers [remoteuser] <\/pre>\n\n\n\n<p>Create a root directory for repositories and add to developers group. in this example a directory named git will be created in directory \/home\/pi <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir -p \/home\/pi\/git \nsudo chgrp developers \/home\/pi\/git\/*\nsudo chmod g+rws \/home\/pi\/git\/*\nls -l\n#total 4\n#drwxrsxr-x 8 pi developers 4096 May 25 00:22 git<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Start working with repositories<\/h3>\n\n\n\n<p>Add a blank repository by creating a directory then initialize git <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir -p \/home\/pi\/git\/myFirstRepository\ncd  \/home\/pi\/git\/myFirstRepository \ngit init --bare --share<\/pre>\n\n\n\n<p>Now at remote workstation with git installed,  navigate to git work folder with remote repository connect it to gitolite server .<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git remote add remoteRepository pi@192.168.0.7:\/home\/pi\/git\/mFirstRepository<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Setup Secure SSH Connection Generate SSH key using the remote workstation then secure copy to RaspberryPi ssh-keygen -t rsa -b 4096 -C &#8220;remoteuser&#8221; enter file path and name to save or press enter to use default (\/home\/pi\/.ssh\/id_rsa): pi This should create 2 filesthat will contain private and public keys. cd .ssh scp pi.pub pi@[RaspberryPi]:\/home\/pi\/pi.pub check &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/doubleecpu.com\/index.php\/raspian-linux-programs\/gitolite\/\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> &#8220;Gitolite&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":261,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-691","page","type-page","status-publish","hentry"],"featured_media_urls":[],"_links":{"self":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/comments?post=691"}],"version-history":[{"count":0,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/691\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/261"}],"wp:attachment":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/media?parent=691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}