{"id":563,"date":"2016-04-25T10:10:21","date_gmt":"2016-04-25T09:10:21","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=563"},"modified":"2016-04-25T10:18:05","modified_gmt":"2016-04-25T09:18:05","slug":"preparing-githubgitlab-development-bastion-server","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2016\/04\/25\/preparing-githubgitlab-development-bastion-server\/","title":{"rendered":"Preparing a Github\/Gitlab Development Bastion Server"},"content":{"rendered":"<p>So you are looking to use github \/ gitlab to manage your infrastructure and development. To do this effectively you will need to prepare your environment. Here is an example.<\/p>\n<p>This is for our ansible playbook.<\/p>\n<h2> Install Required Dependencies <\/h2>\n<pre>\r\nyum update -y\r\nyum install -y vim git ansible tree fail2ban\r\n<\/pre>\n<h2> Add user for repo <\/h2>\n<pre>\r\nuseradd -m -G wheel osan\r\npasswd osan\r\n<\/pre>\n<h2> Secure SSH by disabling root login and changing SSH port <\/h2>\n<pre>\r\nsed 's\/#PermitRootLogin yes\/PermitRootLogin no\/g;s\/#Port 22\/Port 222\/g' -i \/etc\/ssh\/sshd_config\r\nfirewall-cmd --add-port=666\/tcp --permanent\r\nfirewall-cmd --reload\r\nsystemctl restart sshd.service\r\n<\/pre>\n<h2> Generate key for osan user <\/h2>\n<pre>\r\nsu - osan\r\nssh-keygen -f ~\/.ssh\/id_rsa -t rsa -N ''\r\n<\/pre>\n<h2> Output the key you generated <\/h2>\n<pre>\r\ncat ~\/.ssh\/id_rsa.pub\r\n<\/pre>\n<p>The next step is <strong> adding your SSH key above to the &#8216;profiles&#8217; section of your gitlab\/github user. Find this in my profile, under &#8216;SSH KEYS&#8217;.<\/p>\n<p><a href=\"http:\/\/www.haxed.me.uk\/wp-content\/uploads\/2016\/04\/Screen-Shot-2016-04-25-at-10.13.03-AM.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.haxed.me.uk\/wp-content\/uploads\/2016\/04\/Screen-Shot-2016-04-25-at-10.13.03-AM.png\" alt=\"Screen Shot 2016-04-25 at 10.13.03 AM\" width=\"262\" height=\"247\" class=\"alignnone size-full wp-image-565\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.haxed.me.uk\/wp-content\/uploads\/2016\/04\/Screen-Shot-2016-04-25-at-10.13.19-AM.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.haxed.me.uk\/wp-content\/uploads\/2016\/04\/Screen-Shot-2016-04-25-at-10.13.19-AM.png\" alt=\"Screen Shot 2016-04-25 at 10.13.19 AM\" width=\"232\" height=\"212\" class=\"alignnone size-full wp-image-566\" \/><\/a><\/p>\n<h2> Set Git Variables <\/h2>\n<pre>\r\nUSERNAME=yourgitlabusername\r\ngit config --global user.name $USERNAME\r\ngit config --global user.email \"my.username@mydomain.com\"\r\n<\/pre>\n<h2> Clone Project <\/h2>\n<pre>\r\ngit clone user@domainname.com:$USERNAME\/projectname.git\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>So you are looking to use github \/ gitlab to manage your infrastructure and development. To do this effectively you will need to prepare your environment. Here is an example. This is for our ansible playbook. Install Required Dependencies yum &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2016\/04\/25\/preparing-githubgitlab-development-bastion-server\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,42,48,9,7],"tags":[],"class_list":["post-563","post","type-post","status-publish","format-standard","hentry","category-ansible","category-automation","category-git","category-linux","category-management-tools"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=563"}],"version-history":[{"count":4,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/563\/revisions"}],"predecessor-version":[{"id":569,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/563\/revisions\/569"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}