<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>osradar_editor, Author at Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/author/osradar_editor/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 16 Sep 2019 19:41:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>Install ElasticSearch via Ansible</title>
		<link>https://www.osradar.com/install-elasticsearch-via-ansible/</link>
					<comments>https://www.osradar.com/install-elasticsearch-via-ansible/#respond</comments>
		
		<dc:creator><![CDATA[osradar_editor]]></dc:creator>
		<pubDate>Mon, 16 Sep 2019 19:41:45 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ansible]]></category>
		<category><![CDATA[Elasticsearch]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=11307</guid>

					<description><![CDATA[<p>The whole idea of this post is obvious. I have already covered the same objective in a standard fashion but this is about perform the installation via ansible automation. If you don&#8217;t have an understanding on Ansible Directory Structure &#8211; I really recommend to check my other post &#8211;  where I highlighted each key areas [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-elasticsearch-via-ansible/">Install ElasticSearch via Ansible</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The whole idea of this post is obvious. I have already covered the same objective in a standard fashion but this is about perform the installation via ansible automation. If you don&#8217;t have an understanding on Ansible Directory Structure &#8211; I really recommend to check my other <a href="https://www.osradar.com/getting-understand-ansible-structure/">post</a> &#8211;  where I highlighted each key areas that needed to get familiar.</p>
<h4><strong>Inventory File</strong></h4>
<p>In the example, I am going to deploy Three nodes of ElasticSearch &#8211; one represent MASTER role, while other two as DATA role.</p>
<pre><strong>[elastic_master]</strong>
es-0001 ansible_host=172.17.0.10
<strong>
[elastic_data]</strong>
es-0002 ansible_host=172.17.0.11
es-0003 ansible_host=172.17.0.12
</pre>
<p>&nbsp;</p>
<h4><strong>prod.yaml</strong></h4>
<pre>- hosts: elastic_master <span style="color: #008000;">&lt;------------ following actions will be performed against any host listed in <strong>elastic_master</strong> alias which found to be in inventory file</span>
  remote_user: root <span style="color: #008000;">&lt;---------------- to execute the command as root</span>
  become: true
  pre_tasks:
    - name: "Installing basic packages"
      action: yum <span style="color: #008000;">&lt;---------------- calls the yum module and any key that goes with <strong>with_items</strong> will be installed</span>
              name={{ item }}
              state=installed
      with_items:
        - unzip
      when: ansible_os_family == "RedHat" <span style="color: #008000;">&lt;---------------- a condition such that instruct the ansible <strong>pre_tasks</strong> should only suppose to be executed on a Fedora based distribution</span>
  roles:
   - { role: elastic_master_install }


- hosts: elastic_data
  remote_user: root
  become: true
  pre_tasks:
    - name: "Installing basic packages"
      action: yum
              name={{ item }}
              state=installed
      with_items:
        - unzip
      when: ansible_os_family == "RedHat"
  roles:
   - { role: elastic_data_install }</pre>
<p>&nbsp;</p>
<h4><strong>Default File</strong></h4>
<p>As we already covered this variables will be used when files which are in Jinga format are being copied under the Template DIrectory.</p>
<pre># vim roles/elastic_master_install/defaults</pre>
<pre>cluster_name: clusterName
node_master_true: "true"
node_data_true: "false"
node_ingest_true: "false"
path_to_log: /data/elk/logs
path_to_data: /data/elk/data
http_port: 9200
transport_tcp_port: 9300
discovery_zen_ping_unicast_hosts: '["172.17.0.10"]'

### - jvm config
init_heap_size: "-Xms8g"
max_heap_size: "-Xmx8g"
</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h4><strong>Template file Example</strong></h4>
<p>This is how a basic elasticsearch.yaml looks like in Jinja fromat.</p>
<pre># vim roles/elastic_master_install/templates/elasticsearch.yml.j2</pre>
<pre>cluster.name: {{cluster_name}}
node.name: {{inventory_hostname}}
node.master: {{node_master_true}}
node.data: {{node_data_true}}
node.ingest: {{node_ingest_true}}
path.data: {{path_to_data}}
path.logs: {{path_to_log}}
network.host: {{ansible_host}}
</pre>
<p>&nbsp;</p>
<h4><strong>Task File</strong></h4>
<p>This is where we can define all the task that are part of the respective role, in this case task that needed to execute setting up Elasticsearch</p>
<pre># vim roles/elastic_master_install/tasks/main.yml</pre>
<pre>- name: Creating elk user...
  user:
    name: elk
    comment: "elk User"
    createopt: yes
    opt: /opt/elk/
    uid: 1999
    shell: /bin/bash
  become: true

- name: Copying &amp; untar ElasticSearch5.5..
  unarchive: 
    src: /root/Ansible/ElasticSearch5/roles/elastic_master_install/Files/elasticsearch-5.5.0.tar.gz
    dest: /opt/elk/
    owner: elk
    group: elk
    mode: 0755
  become: true

- name: Creating necessary directories..
  file:
    path: /data/elk/{{ item }}
    state: directory
    owner: elk
    group: elk
    mode: 0775
    recurse: yes
  with_items:
     - [data, logs, run]
  become: true

- name: Copying the main config file...
  template: src=elasticsearch.yml.j2 dest={{elasticsearch_config_dir}}/elasticsearch.yml owner=elk group=elk mode=0644 
  become: true
</pre>
<p>&nbsp;</p>
<p>Please note that I have only added files for Role &#8220;<em>elastic_master_install</em>&#8221; =&gt; <strong>Task</strong>/<strong>Template</strong>/<strong>Default</strong>. However, as in the prod.yaml there is another role called &#8220;<em>elastic_data_install</em>&#8221; which you also need to work on as did in above last three steps.</p>
<p>When you have the Directory Structure ready, you can initiate the Ansible by;</p>
<pre># ansible-playbook -i inventory prod.yaml</pre>
<p>&nbsp;</p>
<p><em><strong>&#8220;I hope this has been informative for you&#8221;</strong></em></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-elasticsearch-via-ansible/">Install ElasticSearch via Ansible</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/install-elasticsearch-via-ansible/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Getting Understand Ansible Structure</title>
		<link>https://www.osradar.com/getting-understand-ansible-structure/</link>
					<comments>https://www.osradar.com/getting-understand-ansible-structure/#respond</comments>
		
		<dc:creator><![CDATA[osradar_editor]]></dc:creator>
		<pubDate>Mon, 04 Mar 2019 12:37:52 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ansible]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=11197</guid>

					<description><![CDATA[<p>Getting understand about the directory structure that needed to setup is really important as it helps to ease of things that we can work upon on Ansible. However, different people might follow bit of differ in the structure what we would follow here, but its about each once preference. End of the day, Structure is [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/getting-understand-ansible-structure/">Getting Understand Ansible Structure</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Getting understand about the directory structure that needed to setup is really important as it helps to ease of things that we can work upon on Ansible. However, different people might follow bit of differ in the structure what we would follow here, but its about each once preference. End of the day, Structure is about to help us getting thing done in Ansible easy.</p>
<p><a href="https://www.osradar.com/how-to-install-ansible-on-ubuntu-18-04/">How to install Ansible</a></p>
<p><img loading="lazy" class="alignnone wp-image-11220 size-full" src="https://www.osradar.com/wp-content/uploads/2019/02/Ansible-structure-1-e1551369097715.png" alt="" width="2066" height="1054" srcset="https://www.osradar.com/wp-content/uploads/2019/02/Ansible-structure-1-e1551369097715.png 2066w, https://www.osradar.com/wp-content/uploads/2019/02/Ansible-structure-1-e1551369097715-300x153.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/Ansible-structure-1-e1551369097715-768x392.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/Ansible-structure-1-e1551369097715-1024x522.png 1024w, https://www.osradar.com/wp-content/uploads/2019/02/Ansible-structure-1-e1551369097715-696x355.png 696w, https://www.osradar.com/wp-content/uploads/2019/02/Ansible-structure-1-e1551369097715-1068x545.png 1068w, https://www.osradar.com/wp-content/uploads/2019/02/Ansible-structure-1-e1551369097715-823x420.png 823w, https://www.osradar.com/wp-content/uploads/2019/02/Ansible-structure-1-e1551369097715-1920x980.png 1920w" sizes="(max-width: 2066px) 100vw, 2066px" /></p>
<h4><strong>Project Root Directory:</strong></h4>
<p>This is the top level hierarchy where everything in your ansible work should go upon. It can have any name.</p>
<h4><strong>Inventory File:</strong></h4>
<p>This file should be listed each of the server nodes that the Ansible should work on. Note that prior ssh KEY being copy is mandatory.</p>
<p><img loading="lazy" class="alignnone size-full wp-image-11241" src="https://www.osradar.com/wp-content/uploads/2019/03/inventory.png" alt="" width="475" height="225" srcset="https://www.osradar.com/wp-content/uploads/2019/03/inventory.png 475w, https://www.osradar.com/wp-content/uploads/2019/03/inventory-300x142.png 300w" sizes="(max-width: 475px) 100vw, 475px" /></p>
<ul>
<li>[<strong>web_hosts</strong>] whatever inside this square brackets is a just alias that represent group of hosts. And that group of hosts will be invoke by the &#8220;<em><strong>Prod.yml</strong></em>&#8221; file and once it does, it send the instruction that are listed in this same yaml file. These instruction should be kind of basics, such as system updates, hostname change, etc..</li>
<li>hostnames are just  yet another aliases and they don&#8217;t require any DNS entries nor hostname configured inside OS level. But they come handy when we want to call them later rather mentioning their respective IP addresses.</li>
</ul>
<h4><strong>Prod.yml:</strong></h4>
<p><img loading="lazy" class="alignnone size-full wp-image-11239" src="https://www.osradar.com/wp-content/uploads/2019/03/prodyaml.png" alt="" width="485" height="304" srcset="https://www.osradar.com/wp-content/uploads/2019/03/prodyaml.png 485w, https://www.osradar.com/wp-content/uploads/2019/03/prodyaml-300x188.png 300w" sizes="(max-width: 485px) 100vw, 485px" /></p>
<p>This is what holding the entire work-flow that suppose to be executed by Ansible. It calls aliases listed in &#8220;Inventory FIle&#8221;<strong> [ &#8211; hosts: node_master ]</strong> and by doing so we have the option to select order in which the hosts that needed to configured. Then it&#8217;s best practice to call the individual Roles here with their respective directory aliases so then each specific roles&#8217; set of instruction will be call upon within their sub-directories rather than listed inside this main Prod.yaml file. But, as I already explained above, yet you can call some basic instruction task here under the <strong>[ KEY &#8220;<em>pre_tasks</em>&#8221; ]</strong>. When I say basic tasks, its like general things like update system via <strong>`yum update` </strong>or change hostname and etc..</p>
<h4><strong>Roles Directory:</strong></h4>
<p>This is where you can have Role specific sub-directories and the idea is that each of them then represent it&#8217;s own instruction set. For example, think about you want to install <strong>apahe</strong> and <strong>mysql</strong> via ansible. Then, you can have one directory, lets say &#8220;apache_role&#8221;, whose having what needed to be done on apache and on the other hand other sub-directory, called &#8220;mysql_role&#8221;, will have mysql own specific instruction. As we already covered in<em><strong> &#8220;Prod.yml&#8221;</strong></em> , we can call these sub-directories by their directory alias  when needed.</p>
<h4><strong>Tasks Directories:</strong></h4>
<p>Inside each Role Directory you can have another set of sub-directories each calling task specific instruction. In very basic Task hold a single YAML file which calls every single instruction that needed to be executed on this role, for example, install apache, configuration changes, service restarts, etc..</p>
<h4><strong>Default Directory:</strong></h4>
<p>This is where role specific environment variable are listed within a YAML file.</p>
<h4><strong>Template Directory:</strong></h4>
<p>This is what holds the sample configuration files and they suppose to be in &#8220;Jinja&#8221; format which actually holds configuration data in a variable manner so then when these configuration files are instructed to being copied, those variable are then get replaced by its own parameter that are found in the Default Directory YAML file.</p>
<p>&nbsp;</p>
<p>OK, Now you should have a clear idea on defining your Ansible structure, else you should try to go through couple of times on each points what I explained above until yourself familiar the concept. In my next post, I will be taking real-world scenario on where we could apply Ansible automation.</p>
<p><em><strong>&#8220;I hope this has been informative for you&#8221;</strong></em></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/getting-understand-ansible-structure/">Getting Understand Ansible Structure</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/getting-understand-ansible-structure/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Migrate word-press site to Ghost instances</title>
		<link>https://www.osradar.com/migrate-word-press-site-to-ghost-instances/</link>
					<comments>https://www.osradar.com/migrate-word-press-site-to-ghost-instances/#respond</comments>
		
		<dc:creator><![CDATA[osradar_editor]]></dc:creator>
		<pubDate>Fri, 01 Mar 2019 08:21:16 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ghost]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=11091</guid>

					<description><![CDATA[<p>As the name of the main subject of the post says this is about deploying a equivalent Ghost instance for a site that have been managed by WordPress. IMPORTANT &#8211; At the writing of this post, this would only work on Ghost version 1.0.0. Getting Started Note that through out the document, I will stick [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/migrate-word-press-site-to-ghost-instances/">Migrate word-press site to Ghost instances</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>As the name of the main subject of the post says this is about deploying a equivalent Ghost instance for a site that have been managed by WordPress.</p>
<p>IMPORTANT &#8211; At the writing of this post, this would only work on Ghost version 1.0.0.</p>
<h2><strong>Getting Started</strong></h2>
<p>Note that through out the document, I will stick to Ubuntu 18.04 OS version.</p>
<div class="td-g-rec td-g-rec-id-content_inline td_uid_2_5c7620a1d8bfb_rand td_block_template_1 "></div>
<h4 class="td-g-rec td-g-rec-id-content_inline td_uid_2_5c6fd84a5cb42_rand td_block_template_1 "><strong style="color: #111111; font-family: Roboto, sans-serif; font-size: 19px;">Step 01</strong><span style="color: #111111; font-family: Roboto, sans-serif; font-size: 19px;"> — Install WordPress plugin that allow to back up the existing post metadata</span></h4>
<ul>
<li>http://sitea.com/wp-admin -&gt; plugins -&gt; Add new</li>
<li>Search &#8220;ghost&#8221;</li>
</ul>
<div><img loading="lazy" class="alignnone size-full wp-image-11166" src="https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-27_13-12-03.png" alt="" width="563" height="256" srcset="https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-27_13-12-03.png 563w, https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-27_13-12-03-300x136.png 300w" sizes="(max-width: 563px) 100vw, 563px" /></div>
<div>Make sure to &#8220;activate&#8221; once installed.</div>
<div></div>
<h4><strong style="color: #111111; font-family: Roboto, sans-serif; font-size: 19px;">Step 02</strong><span style="color: #111111; font-family: Roboto, sans-serif; font-size: 19px;"> — Download the Ghost compatible JSON that has got the enough metadata </span></h4>
<ul>
<li>Tools -&gt; Export to Ghost &gt;</li>
<li>Then click &#8220;<em><strong>Download Ghost File</strong></em>&#8221; and this will save a JSON containing all the metadata that required to spin up the equivalent Ghost instance.</li>
</ul>
<div></div>
<h4><strong style="color: #111111; font-family: Roboto, sans-serif; font-size: 19px;">Step 03</strong><span style="color: #111111; font-family: Roboto, sans-serif; font-size: 19px;"> — Export Images that are part of the existing WordPress site.</span></h4>
<ul>
<li>This step involves coping all the directory &amp; files that are belongs to WEB site&#8217;s root Directory -&gt; wp-content -&gt; uploads. For example /var/www/html/siteA/wp-content/uploads/.</li>
<li>To make a copy against all these data, you can use;
<ul>
<li>WInSCP from windows systems / SCP from Linux =&gt; SSH service should be running on the server that host the existing wordpress site.</li>
<li>FTP file transfer client =&gt; FTP service should be running on the server that host the existing wordpress site</li>
<li>Or check you cPannel options that probably support this.</li>
</ul>
</li>
</ul>
<div></div>
<div>
<h4><strong style="color: #111111; font-family: Roboto, sans-serif; font-size: 19px;">Step 04</strong><span style="color: #111111; font-family: Roboto, sans-serif; font-size: 19px;"> — Spinning up new Ghost instance. </span></h4>
<ul>
<li>To upload all these downloads we should have a Ghost Instance running. Check my previous post on;
<ul>
<li><a href="https://www.osradar.com/setting-up-ghost-cms-on-linux/">Setting up Ghost CMS on Linux</a></li>
<li><a href="https://www.osradar.com/multiple-ghost-instances-on-a-single-server/">Multiple Ghost Instances on a Single Server</a></li>
</ul>
</li>
</ul>
</div>
<div></div>
<h4><strong style="color: #111111; font-family: Roboto, sans-serif; font-size: 19px;">Step 05</strong><span style="color: #111111; font-family: Roboto, sans-serif; font-size: 19px;"> — Import the downloaded images into Ghost instance</span></h4>
<ul>
<li>First, upload all the downloaded files &amp; folders at step 03 into your new Ghost instances. These data should go under /var/www/ghostName/content/images/</li>
<li>Now we need to make some changes to the Json that we downloaded in step02. Replace <code>wp-content/uploads</code> with <code>content/images</code> by executing the following command.<br />
<span style="background-color: #f1f1f1; font-family: Consolas, Monaco, monospace;"># sed -i.bak -e &#8216;s|wp-content\\/uploads|content\\/images|g&#8217; downloadGhostInstance.json</span></li>
<li>Browse http://siteA.com/ghost/settings/labs/ and Click on &#8220;<em><strong>Choose File</strong></em>&#8221; and select the JSON file that we just updated, and click &#8220;<em><strong>Import</strong></em>&#8220;</li>
</ul>
<div></div>
<h4><strong style="color: #111111; font-family: Roboto, sans-serif; font-size: 19px;">Step 06</strong><span style="color: #111111; font-family: Roboto, sans-serif; font-size: 19px;"> — Setting up the necessary permissions. </span></h4>
<pre># chown -R ghost:ghost /var/www/ghost/content/images</pre>
<div></div>
<div>That&#8217;s it. Now you can restart the Ghost instance and have your WordPress site on Ghost.!</div>
<div></div>
<div></div>
<div><em><strong>&#8220;I hope this has been informative for you&#8221;</strong></em></div>
<p>The post <a rel="nofollow" href="https://www.osradar.com/migrate-word-press-site-to-ghost-instances/">Migrate word-press site to Ghost instances</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/migrate-word-press-site-to-ghost-instances/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Multiple Ghost Instances on a Single Server</title>
		<link>https://www.osradar.com/multiple-ghost-instances-on-a-single-server/</link>
					<comments>https://www.osradar.com/multiple-ghost-instances-on-a-single-server/#respond</comments>
		
		<dc:creator><![CDATA[osradar_editor]]></dc:creator>
		<pubDate>Thu, 28 Feb 2019 09:37:49 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[ghost]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=11061</guid>

					<description><![CDATA[<p>Hosting different domains on different nodes cost you more and that&#8217;s what Virtual Hosting add more benefit by allowing multiple domains to co-exists within a single server. However, the same concept to get working on Ghost there some additional steps that required. Let jump and get started. Core areas that we will be working on: [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/multiple-ghost-instances-on-a-single-server/">Multiple Ghost Instances on a Single Server</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hosting different domains on different nodes cost you more and that&#8217;s what Virtual Hosting add more benefit by allowing multiple domains to co-exists within a single server. However, the same concept to get working on Ghost there some additional steps that required. Let jump and get started.</p>
<p>Core areas that we will be working on:</p>
<ul>
<li>Make a copy of the existing Ghost instance and tweak some setting to host new blog</li>
<li>Add additional VirtualHost on nginx to host the new domain &#8211; newblog.osradar.com</li>
<li>Manage separate DB within MySQL to host the new blog</li>
<li>Create systemD unit files to manage each blog</li>
</ul>
<p>&nbsp;</p>
<h2><strong>Getting Started</strong></h2>
<p>Note that through out the document, I will stick to Ubuntu 18.04 OS version.</p>
<div class="td-g-rec td-g-rec-id-content_inline td_uid_2_5c6fd84a5cb42_rand td_block_template_1 "></div>
<div>
<h4><strong>Step 01</strong> — Copy the existing Ghost instance and make the necessary changes</h4>
</div>
<pre># cd /var/www/
# cp -pr ghost ghost-new
# cd /var/www/ghost-new/system/files/
# mv blog.osradar.com.conf newblog.osradar.com.conf</pre>
<h4></h4>
<h4><strong>Step 02</strong> — Create new VirtualHost</h4>
<pre># cd /etc/nginx/sites-available/
# ln -s /var/www/ghost-new/system/files/newblog.osradar.com.conf newblog.osradar.com.conf
# cd /etc/nginx/sites-enabled/
# ln -s /etc/nginx/sites-available/newblog.osradar.com.conf newblog.osradar.com.conf</pre>
<pre># vim /etc/nginx/sites-enabled/newblog.osradar.com.conf</pre>
<pre>server {
    listen 80;
    listen [::]:80;

    server_name <strong>newblog.osradar.com</strong>;
    root /var/www/<strong>ghost-new</strong>/system/nginx-root;

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_pass http://<strong>127.0.0.1:2369</strong>;
        
    }

    location ~ /.well-known {
        allow all;
    }

    client_max_body_size 50m;
}</pre>
<p>&nbsp;</p>
<h4><strong>Step 03</strong> — Manage new MySQL DB</h4>
<pre># mysql -uroot -p</pre>
<pre>mysql&gt; create database <strong>new_blog_osradar</strong>;
mysql&gt; GRANT ALL ON <strong>new_blog_osradar</strong>.* TO root@'localhost'
mysql&gt; flush privileges;</pre>
<p><strong>new_blog_osradar</strong> =&gt; is a new database to host the new blog</p>
<pre># grep database /var/www/ghost/config.production.json

  "database": {
      "database": "ghost_production"

</pre>
<p><strong>ghost_production</strong> =&gt; is the database name for the existing Ghost instance. Lets back it up and restore with the newly created DB.</p>
<pre># mysqldump -uroot -p --no-data ghost_production &gt; backup.sql
# mysql -uroot -p new_blog_osradar&lt;backup.sql</pre>
<p>Lets change the  required configuration in the new instance of Ghost</p>
<pre># vim /var/www/ghost-new/config.production.json</pre>
<pre>{
  "url": "<strong>http://newblog.osradar.com</strong>",
  "server": {
    "port": <strong>2369</strong>,
    "host": "127.0.0.1"
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "root",
      "password": "password",
      "database": "<strong>new_blog_osradar</strong>"
    }
  },</pre>
<p>&nbsp;</p>
<h4><strong>Step 04</strong> — Create new SystemD unit file</h4>
<pre># cd /etc/systemd/system/
# cp ghost_blog-osradar-com.service <strong>ghost_newblog-osradar-com.service
</strong># vim ghost_newblog-osradar-com.service</pre>
<pre>[Unit]
Description=Ghost systemd service for blog: newblog-osradar-com
Documentation=https://docs.ghost.org

[Service]
Type=simple
<strong>WorkingDirectory=/var/www/ghost-new</strong>
User=999
Environment="NODE_ENV=production"
ExecStart=/usr/local/bin/node /usr/local/bin/ghost run
Restart=always

[Install]
WantedBy=multi-user.target</pre>
<p>&nbsp;</p>
<p>That&#8217;s it. Now its all about setting up DNS records from different domains to map the single IP address that we have on our system. So, when browse from http://blog.osradar.com to http://newblog.osradar.com Nginx will take care the routing in between domains.</p>
<p><em><strong>&#8220;I hope this has been informative for you&#8221;</strong></em></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/multiple-ghost-instances-on-a-single-server/">Multiple Ghost Instances on a Single Server</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/multiple-ghost-instances-on-a-single-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Setting up Ghost CMS on Linux</title>
		<link>https://www.osradar.com/setting-up-ghost-cms-on-linux/</link>
					<comments>https://www.osradar.com/setting-up-ghost-cms-on-linux/#respond</comments>
		
		<dc:creator><![CDATA[osradar_editor]]></dc:creator>
		<pubDate>Tue, 26 Feb 2019 18:24:58 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ghost]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=10964</guid>

					<description><![CDATA[<p>If you visit this page intentionally, I think you know what &#8220;Ghost&#8221; is about and what we can use with that. However, to brief about about this new guy &#8211;  actually not that new as the first release suppose to happen back in 2013/2014 &#8211; I think its a worth while. What.? Built on NodeJS, [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/setting-up-ghost-cms-on-linux/">Setting up Ghost CMS on Linux</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you visit this page intentionally, I think you know what &#8220;Ghost&#8221; is about and what we can use with that. However, to brief about about this new guy &#8211;  actually not that new as the first release suppose to happen back in 2013/2014 &#8211; I think its a worth while.</p>
<h4><strong>What.?</strong></h4>
<p>Built on NodeJS, its a same kind of Content Management System as &#8220;WordPress&#8221;, but intention is more biased on blogs rather hosting common web site content. Ghost uses MySQL as a backend data store as does in WordPress, though when it comes to creating posts Ghost uses &#8220;Markdown&#8221; rather than visual WYSIWYG. Yes, both platforms are open source and free to download.</p>
<p>&nbsp;</p>
<h2><strong>Getting Started</strong></h2>
<p>Note that through out the document, I will stick to Ubuntu 18.04 OS version.</p>
<h4><strong>Step 01</strong> — Required Package Installation</h4>
<pre># apt-get update</pre>
<pre># apt-get install -y nginx mariadb-server</pre>
<p>&nbsp;</p>
<h4><strong>Step 02</strong> — Create standard user which Ghost CMS can be used with</h4>
<pre># useradd --home-dir /home/blog -m --shell /bin/bash blog</pre>
<pre># usermod -aG sudo blog
# passwd blog</pre>
<p>&nbsp;</p>
<h4><strong>Step 03</strong> — Modify mysql default configuration</h4>
<pre># sudo mysql</pre>
<pre>MariaDB [(none)]&gt; UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE user = 'root' AND plugin = 'unix_socket';
MariaDB [(none)]&gt; FLUSH PRIVILEGES;
MariaDB [(none)]&gt; exit</pre>
<pre># sudo mysql_secure_installation</pre>
<p>while going through the interactive mysql configuration, make sure to set the mysql root password.</p>
<p>&nbsp;</p>
<h4><strong>Step 04</strong> — NodeJS Installation</h4>
<pre># curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash
# apt-get install -y nodejs</pre>
<p>Optionally, you can install specific nodeJS version by</p>
<pre># apt-get install npm
# npm install n -g
# n latest or # n 6.9.1
# node -v</pre>
<p>&nbsp;</p>
<h4><strong>Step 05</strong> — Ghost installation</h4>
<p>Install ghost-cli</p>
<pre># sudo npm install ghost-cli@latest -g

OR need a specific version do;
# sudo npm install ghost-cli@1.0.0 -g</pre>
<p>&nbsp;</p>
<p>Create directory structure to host the Ghost instance</p>
<pre># sudo mkdir -p /var/www/ghost
# sudo chown blog.blog /var/www/ghost
# sudo chmod 775 /var/www/ghost</pre>
<p>&nbsp;</p>
<p>Install the ghost instance</p>
<pre># cd /var/www/ghost/
# ghost install
OR
# ghost install 1.0.0</pre>
<pre>? Enter your blog URL: https://blog.osradar.com
? Enter your MySQL hostname: localhost
? Enter your MySQL username: root
? Enter your MySQL password: [hidden]
? Enter your Ghost database name: ghost_prod
? Do you wish to set up "ghost" mysql user? Yes
? Do you wish to set up Nginx? Yes
? Do you wish to set up SSL? Yes
? Do you wish to set up Systemd? Yes
? Do you want to start Ghost? Yes</pre>
<p>&nbsp;</p>
<h4><strong>Step 06</strong> — Make sure responsible daemons are up &amp; running</h4>
<pre># systemctl status mariadb.service
# systemctl status nginx.service
# systemctl status ghost_blog-osradar-com.service</pre>
<p>&nbsp;</p>
<p>Fire up your favorite browser and visit http://blog.osradar.com</p>
<p><img loading="lazy" class="alignnone size-full wp-image-11059" src="https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-22_15-29-42.jpg" alt="" width="1087" height="741" srcset="https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-22_15-29-42.jpg 1087w, https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-22_15-29-42-300x205.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-22_15-29-42-768x524.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-22_15-29-42-1024x698.jpg 1024w, https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-22_15-29-42-218x150.jpg 218w, https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-22_15-29-42-696x474.jpg 696w, https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-22_15-29-42-1068x728.jpg 1068w, https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-22_15-29-42-616x420.jpg 616w" sizes="(max-width: 1087px) 100vw, 1087px" /></p>
<p>&nbsp;</p>
<p>In the up coming posts, I will be working on..</p>
<ul>
<li><a href="https://www.osradar.com/multiple-ghost-instances-on-a-single-server/">Multiple Ghost environment on a single server</a></li>
<li><a href="https://www.osradar.com/migrate-word-press-site-to-ghost-instances/">Migrate word-press site to Ghost instances</a></li>
</ul>
<p><strong><em>&#8220;Hope this has been informative for you&#8221;</em></strong></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/setting-up-ghost-cms-on-linux/">Setting up Ghost CMS on Linux</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/setting-up-ghost-cms-on-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>OpenVPN authentication with freeRADIUS</title>
		<link>https://www.osradar.com/openvpn-authentication-with-freeradius/</link>
					<comments>https://www.osradar.com/openvpn-authentication-with-freeradius/#comments</comments>
		
		<dc:creator><![CDATA[osradar_editor]]></dc:creator>
		<pubDate>Mon, 18 Feb 2019 08:10:08 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[freeradius]]></category>
		<category><![CDATA[openvpn]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=10865</guid>

					<description><![CDATA[<p>So this post we will be working on integrating them together making them a very useful infrastructure that facilitate user authentication from OpenVPN to freeRadius. The advantage of this design is that it allows central user account administration inside mysql database for any incoming OpenVPN user logins. Couple of my last documents followed up on [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/openvpn-authentication-with-freeradius/">OpenVPN authentication with freeRADIUS</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>So this post we will be working on integrating them together making them a very useful infrastructure that facilitate user authentication from OpenVPN to freeRadius. The advantage of this design is that it allows central user account administration inside mysql database for any incoming OpenVPN user logins.</p>
<p>Couple of my last documents followed up on how to setup</p>
<ul>
<li><a href="https://www.osradar.com/setup-vpn-access-provisioning-server-on-top-of-ubuntu-18-04/">OpenVPN server.</a></li>
<li><a href="https://www.osradar.com/freeradius-with-mysql-backend/">freeRADIUS server.</a></li>
</ul>
<h2><strong>Getting Started</strong></h2>
<p>Note that through out the document, I will stick to Ubuntu 18.04 OS version.</p>
<h4><strong>Step 01</strong> — Required Package Installation</h4>
<pre># apt-get update
# apt-get install libgcrypt11-dev build-essential</pre>
<h4><strong>Step 02</strong> — build radius plugin that helps to communicate from OpenVPN to freeRadius</h4>
<p>Downloading and building</p>
<pre># wget http://www.nongnu.org/radiusplugin/radiusplugin_v2.1a_beta1.tar.gz
# tar xvf radiusplugin_v2.1a_beta1.tar.gz</pre>
<pre># cd radiusplugin_v2.1a_beta1
# make</pre>
<p>Copy the built plugin to appropriate location</p>
<pre># mkdir /etc/openvpn/radius
# cp -r radiusplugin.so /etc/openvpn/radius</pre>
<h4><strong>Step 03</strong> — Configure built Plugin to work with freeRadius server</h4>
<pre># vim /etc/openvpn/radius/radius.cnf</pre>
<pre>NAS-Identifier=anyName

# The service type which is sent to the RADIUS server
Service-Type=5

# The framed protocol which is sent to the RADIUS server
Framed-Protocol=1

# The NAS port type which is sent to the RADIUS server
NAS-Port-Type=5

# The NAS IP address which is sent to the RADIUS server
NAS-IP-Address=172.17.0.56

# Path to the OpenVPN configfile. The plugin searches there for
# client-config-dir PATH   (searches for the path)
# status FILE     		   (searches for the file, version must be 1)
# client-cert-not-required (if the option is used or not)
# username-as-common-name  (if the option is used or not)

# Path to our OpenVPN configuration file. Each OpenVPN configuration file needs its own radiusplugin configuration file as well
OpenVPNConfig=/etc/openvpn/server.conf


# Support for topology option in OpenVPN 2.1
# If you don't specify anything, option "net30" (default in OpenVPN) is used. 
# You can only <span class="hljs-operator"><span class="hljs-keyword">use</span> one <span class="hljs-keyword">of</span> the options <span class="hljs-keyword">at</span> the same <span class="hljs-keyword">time</span>.
# <span class="hljs-keyword">If</span> you <span class="hljs-keyword">use</span> topology <span class="hljs-keyword">option</span> <span class="hljs-string">"subnet"</span>, fill <span class="hljs-keyword">in</span> the <span class="hljs-keyword">right</span> netmask, <span class="hljs-keyword">e</span>.<span class="hljs-keyword">g</span>. <span class="hljs-keyword">from</span> OpenVPN <span class="hljs-keyword">option</span> <span class="hljs-string">"--server NETWORK NETMASK"</span>  
subnet=<span class="hljs-number">255.255</span><span class="hljs-number">.255</span><span class="hljs-number">.0</span>
# <span class="hljs-keyword">If</span> you <span class="hljs-keyword">use</span> topology <span class="hljs-keyword">option</span> <span class="hljs-string">"p2p"</span>, fill <span class="hljs-keyword">in</span> the <span class="hljs-keyword">right</span> network, <span class="hljs-keyword">e</span>.<span class="hljs-keyword">g</span>. <span class="hljs-keyword">from</span> OpenVPN <span class="hljs-keyword">option</span> <span class="hljs-string">"--server NETWORK NETMASK"</span>
# p2p=<span class="hljs-number">10.8</span><span class="hljs-number">.0</span><span class="hljs-number">.1</span>


# Allows the <span class="hljs-keyword">plugin</span> <span class="hljs-keyword">to</span> overwrite the <span class="hljs-keyword">client</span> config <span class="hljs-keyword">in</span> <span class="hljs-keyword">client</span> config <span class="hljs-keyword">file</span> <span class="hljs-keyword">directory</span>,
# <span class="hljs-keyword">default</span> <span class="hljs-keyword">is</span> <span class="hljs-literal">true</span>
overwriteccfiles=<span class="hljs-literal">true</span>

# Allows the <span class="hljs-keyword">plugin</span> <span class="hljs-keyword">to</span> <span class="hljs-keyword">use</span> auth control files <span class="hljs-keyword">if</span> OpenVPN (&gt;= <span class="hljs-number">2.1</span> rc8) provides them.
# <span class="hljs-keyword">default</span> <span class="hljs-keyword">is</span> <span class="hljs-literal">false</span>
# useauthcontrolfile=<span class="hljs-literal">false</span>

# <span class="hljs-keyword">Only</span> the accouting functionality <span class="hljs-keyword">is</span> used, <span class="hljs-keyword">if</span> <span class="hljs-keyword">no</span> <span class="hljs-keyword">user</span> <span class="hljs-keyword">name</span> <span class="hljs-keyword">to</span> forwarded <span class="hljs-keyword">to</span> the <span class="hljs-keyword">plugin</span>, the common <span class="hljs-keyword">name</span> <span class="hljs-keyword">of</span> certificate <span class="hljs-keyword">is</span> used
# <span class="hljs-keyword">as</span> <span class="hljs-keyword">user</span> <span class="hljs-keyword">name</span> <span class="hljs-keyword">for</span> radius accounting.
# <span class="hljs-keyword">default</span> <span class="hljs-keyword">is</span> <span class="hljs-literal">false</span>
# accountingonly=<span class="hljs-literal">false</span>


# <span class="hljs-keyword">If</span> the accounting <span class="hljs-keyword">is</span> non essential, nonfatalaccounting can be <span class="hljs-keyword">set</span> <span class="hljs-keyword">to</span> <span class="hljs-literal">true</span>. 
# <span class="hljs-keyword">If</span> <span class="hljs-keyword">set</span> <span class="hljs-keyword">to</span> <span class="hljs-literal">true</span> all <span class="hljs-keyword">errors</span> during the accounting <span class="hljs-keyword">procedure</span> <span class="hljs-keyword">are</span> ignored, which can be
# - radius accounting can fail
# - FramedRouted (<span class="hljs-keyword">if</span> configured) maybe <span class="hljs-keyword">not</span> configured correctly
# - <span class="hljs-keyword">errors</span> during vendor specific <span class="hljs-keyword">attributes</span> script execution <span class="hljs-keyword">are</span> ignored
# But <span class="hljs-keyword">if</span> <span class="hljs-keyword">set</span> <span class="hljs-keyword">to</span> <span class="hljs-literal">true</span> the <span class="hljs-keyword">performance</span> <span class="hljs-keyword">is</span> increased because OpenVPN does <span class="hljs-keyword">not</span> <span class="hljs-keyword">block</span> during the accounting <span class="hljs-keyword">procedure</span>.
# <span class="hljs-keyword">default</span> <span class="hljs-keyword">is</span> <span class="hljs-literal">false</span>
nonfatalaccounting=<span class="hljs-literal">false</span>

# <span class="hljs-keyword">Path</span> <span class="hljs-keyword">to</span> a script <span class="hljs-keyword">for</span> vendor specific <span class="hljs-keyword">attributes</span>.
# Leave it <span class="hljs-keyword">out</span> <span class="hljs-keyword">if</span> you don<span class="hljs-string">'t use an own script.
# vsascript=/root/workspace/radiusplugin_v2.0.5_beta/vsascript.pl

# Path to the pipe for communication with the vsascript.
# Leave it out if you don'</span><span class="hljs-keyword">t</span> <span class="hljs-keyword">use</span> an own script.
# vsanamedpipe=/tmp/vsapipe

# A radius <span class="hljs-keyword">server</span> definition, there could be more <span class="hljs-keyword">than</span> one.
# The <span class="hljs-keyword">priority</span> <span class="hljs-keyword">of</span> the <span class="hljs-keyword">server</span> depends <span class="hljs-keyword">on</span> the <span class="hljs-keyword">order</span> <span class="hljs-keyword">in</span> this <span class="hljs-keyword">file</span>. The <span class="hljs-keyword">first</span> one has the highest <span class="hljs-keyword">priority</span>.
<span class="hljs-keyword">server</span>
{
	# The UDP port <span class="hljs-keyword">for</span> radius accounting.
	acctport=<span class="hljs-number">1813</span>
	# The UDP port <span class="hljs-keyword">for</span> radius <span class="hljs-keyword">authentication</span>.
	authport=<span class="hljs-number">1812</span>
	# The <span class="hljs-keyword">name</span> <span class="hljs-keyword">or</span> ip address <span class="hljs-keyword">of</span> the radius <span class="hljs-keyword">server</span>.
	<span class="hljs-keyword">name</span>=172.17.0.55
	# How many times should the <span class="hljs-keyword">plugin</span> send the <span class="hljs-keyword">if</span> there <span class="hljs-keyword">is</span> <span class="hljs-keyword">no</span> response?
	retry=<span class="hljs-number">1</span>
	# How <span class="hljs-keyword">long</span> should the <span class="hljs-keyword">plugin</span> <span class="hljs-keyword">wait</span> <span class="hljs-keyword">for</span> a response?
	<span class="hljs-keyword">wait</span>=<span class="hljs-number">1</span>
	# The <span class="hljs-keyword">shared</span> secret.
	sharedsecret=mysecret
}</span></pre>
<p>&nbsp;</p>
<h4><strong>Step 04</strong> — Template OpenVPN server configuration file</h4>
<pre># vim /etc/openvpn/server.conf</pre>
<pre>port 443 
proto tcp 
dev tun 
server 10.11.0.0 255.255.255.0 
ca /etc/openvpn/easy-rsa/keys/ca.crt 
cert /etc/openvpn/easy-rsa/keys/server.crt 
key /etc/openvpn/easy-rsa/keys/server.key 
dh /etc/openvpn/easy-rsa/keys/dh2048.pem
plugin /etc/openvpn/radius/radiusplugin.so /etc/openvpn/radius/radius.cnf ifconfig-pool-persist ipp.txt persist-key 
persist-tun 
keepalive 10 60 
reneg-sec 0 
comp-lzo 
tun-mtu 1468 
tun-mtu-extra 32 
mssfix 1400 
push "persist-key" 
push "persist-tun" 
push "redirect-gateway def1" 
push "dhcp-option DNS 8.8.8.8" 
push "dhcp-option DNS 8.8.4.4" 
status /etc/openvpn/443.log 
verb 3
client-cert-not-required</pre>
<p>&nbsp;</p>
<h4><strong>Step 05</strong> — Service start up</h4>
<pre># systemctl start openvpn@server</pre>
<h2><strong>Client Work-Station End</strong></h2>
<h4><strong>Step 06</strong> — Required Package Installation</h4>
<pre># apt-get update &amp;&amp; apt-get install -y network-manager-openvpn</pre>
<h4><strong>Step 07</strong> — Launch `nm-connection-editor` &amp; create new VPN profile</h4>
<pre># nm-connection-editor</pre>
<p>Next, Click (+) sign &amp; Select &#8220;OpenVPN&#8221; from the drop-down menu</p>
<p><img loading="lazy" class="alignnone size-full wp-image-10917" src="https://www.osradar.com/wp-content/uploads/2019/02/vpnpassword.png" alt="" width="451" height="523" srcset="https://www.osradar.com/wp-content/uploads/2019/02/vpnpassword.png 451w, https://www.osradar.com/wp-content/uploads/2019/02/vpnpassword-259x300.png 259w, https://www.osradar.com/wp-content/uploads/2019/02/vpnpassword-362x420.png 362w" sizes="(max-width: 451px) 100vw, 451px" /><br />
Check my previous <a href="https://www.osradar.com/setup-vpn-access-provisioning-server-on-top-of-ubuntu-18-04/">post</a> on getting required certificate. Also, once the new VPN profile is saved, start the launch by clicking the configured Profile name. Note that prior to VPN establishment, your credentials are being passed to OpenVPN server which in turn redirect them to freeRadius. However, actual process of credential verification is being performed at mysql database where we setup user details.</p>
<h4><em><strong>&#8220;I hope this has been informative&#8221;</strong></em></h4>
<p>The post <a rel="nofollow" href="https://www.osradar.com/openvpn-authentication-with-freeradius/">OpenVPN authentication with freeRADIUS</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/openvpn-authentication-with-freeradius/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>FreeRadius with mysql Backend</title>
		<link>https://www.osradar.com/freeradius-with-mysql-backend/</link>
					<comments>https://www.osradar.com/freeradius-with-mysql-backend/#respond</comments>
		
		<dc:creator><![CDATA[osradar_editor]]></dc:creator>
		<pubDate>Sat, 16 Feb 2019 23:35:38 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[freeradius]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=10816</guid>

					<description><![CDATA[<p>What is Freeradius: FreeRADIUS is a yet another service that we can setup on Linux and the protocol by which &#8211; the RADIUS &#8211; we can take advantage of providing functionalities of authentication, authorization and accounting. It has been developing very long time back and yet its very powerful and modern enough to provide authentication [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/freeradius-with-mysql-backend/">FreeRadius with mysql Backend</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h4><strong>What is Freeradius:</strong></h4>
<p>FreeRADIUS is a yet another service that we can setup on Linux and the protocol by which &#8211; the RADIUS &#8211; we can take advantage of providing functionalities of authentication, authorization and accounting. It has been developing very long time back and yet its very powerful and modern enough to provide authentication facility to systems &amp; applications, specially in networking.</p>
<p>In this article we focus on its authentication ability and even beyond taking &#8220;mysql&#8221; database as the source of database to retrieve authentication credentials. However, there are other sources you could integrated as well, such as openLDAP, simple flat file and etc.</p>
<p><strong>Now lets install FreeRadius with mysql Backend</strong></p>
<h2><strong>Getting Started.</strong></h2>
<p>Note that through out the document, I will stick to Ubuntu 18.04 OS version.</p>
<h4><strong>Step 01</strong> — Required Package Installation</h4>
<pre class="lang:sh decode:true"># apt-get update
# apt-get install -y freeradius freeradius-mysql freeradius-utils php-common php-gd php-curl php-mysql mysql-server mysql-client</pre>
<h4><strong>Step 02</strong> — Setting up password for mysql own ROOT user</h4>
<pre class="lang:sh decode:true "># mysql_secure_installation</pre>
<pre class="lang:sh decode:true ">Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: y

There are three levels of password validation policy:

LOW    Length &gt;= 8
MEDIUM Length &gt;= 8, numeric, mixed case, and special characters
STRONG Length &gt;= 8, numeric, mixed case, special characters and dictionary                  file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0
Please set the password for root here.

New password: 

Re-enter new password: 

Estimated strength of the password: 50 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done! 
</pre>
<h4><strong>Step 03</strong> — Create &#8216;radius&#8217; database and import required Schema which already available.</h4>
<pre class="lang:sh decode:true"># mysql -uroot -p
</pre>
<pre class="lang:sh decode:true">mysql&gt; uninstall plugin validate_password;
mysql&gt; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
mysql&gt; CREATE DATABASE radius;
mysql&gt; exit</pre>
<pre class="lang:sh decode:true "># cd /etc/freeradius/3.0/mods-config/sql/main/mysql/

# mysql -uroot -pYourMysqlPass radius &lt; schema.sql
# mysql -uroot -pYourMysqlpass radius &lt; setup.sql</pre>
<p>&nbsp;</p>
<h4><strong>Step 04</strong> — Enable &#8216;sql&#8217; module to be used with</h4>
<pre class="lang:sh decode:true "># cd /etc/freeradius/3.0/mods-enabled
# ln -s ../mods-available/sql sql</pre>
<h4><strong>Step 05</strong> — Instruct freeRadius to use SQL as the backend store, rather local File</h4>
<p>To achieve this, for all the below sections, remove the “file” directive and add the “sql” instead</p>
<pre class="lang:sh decode:true crayon-selected">authorize {
...
}
accounting {
...
}
post-auth {
...
}
session{
...
}</pre>
<p>&nbsp;</p>
<h4><strong>Step 06</strong> — Reflect the correct details in Radius SQL module’s config</h4>
<pre># vim <span class="crayon-o">/</span><span class="crayon-v">etc</span><span class="crayon-o">/</span><span class="crayon-v">freeradius</span><span class="crayon-o">/</span><span class="crayon-cn">3.0</span><span class="crayon-o">/</span><span class="crayon-v">mods</span><span class="crayon-o">-</span><span class="crayon-e">available/sql</span></pre>
<pre>driver = "rlm_sql_mysql"
 
dialect = "mysql"
 
 server = "localhost"
 port = 3306
 login = "root"
 password = "password-which-we-setup-in-step2"
 radius_db = "radius"
read_clients = yes</pre>
<h4><strong>Step 07</strong> — Running freeRADIUS in foreground to check the status..</h4>
<pre># freeradius -X</pre>
<pre>Listening on auth address 127.0.0.1 port 18120 bound to server inner-tunnel
Listening on auth address * port 1812 bound to server default
Listening on acct address * port 1813 bound to server default
Listening on auth address :: port 1812 bound to server default
Listening on acct address :: port 1813 bound to server default
Listening on proxy address * port 59791
Listening on proxy address :: port 36140
Ready to process requests</pre>
<p>The output above is a good indication of a working configuration..</p>
<h4><strong>Step 08</strong> — For a testing purpose, add basic authentication details, such as username, password, NAS ip address, etc..</h4>
<pre># mysql -uroot -p</pre>
<pre>mysql&gt; INSERT INTO nas VALUES (NULL , '0.0.0.0/0', 'myNAS', 'other', NULL , 'mysecret', NULL , NULL , 'RADIUS Client');
mysql&gt; INSERT INTO radcheck (username, attribute, op, value) VALUES ('testuser', 'Cleartext-Password', ':=', 'testpassword');
mysql&gt; INSERT INTO radusergroup (username, groupname, priority) VALUES ('testuser', 'testgroup', '1');
mysql&gt; INSERT INTO radgroupreply (groupname, attribute, op, value) VALUES ('testgroup', 'Service-Type', ':=', 'Framed-User'), ('testgroup', 'Framed-Protocol', ':=', 'PPP'), ('testgroup', 'Framed-Compression', ':=', 'Van-Jacobsen-TCP-IP');</pre>
<h4>Lets check updated details by going through each mysql tables</h4>
<pre>mysql&gt; select * from nas;
+----+-----------+-----------+-------+-------+----------+--------+-----------+---------------+
| id | nasname   | shortname | type  | ports | secret   | server | community | description   |
+----+-----------+-----------+-------+-------+----------+--------+-----------+---------------+
|  1 | 0.0.0.0/0 | myNAS     | other |  NULL | mysecret | NULL   | NULL      | RADIUS Client |
+----+-----------+-----------+-------+-------+----------+--------+-----------+---------------+</pre>
<pre>mysql&gt; select * from radcheck;
+----+----------+--------------------+----+--------------+
| id | username | attribute          | op | value        |
+----+----------+--------------------+----+--------------+
|  1 | testuser | Cleartext-Password | := | testpassword |
+----+----------+---------------+----+-------------------+</pre>
<pre>mysql&gt; select * from radusergroup;
+----------+-----------+----------+
| username | groupname | priority |
+----------+-----------+----------+
| testuser | testgroup |        1 |
+----------+-----------+----------+</pre>
<pre>mysql&gt; select * from radgroupreply;
+----+-----------+--------------------+----+---------------------+
| id | groupname | attribute          | op | value               |
+----+-----------+--------------------+----+---------------------+
|  1 | testgroup | Service-Type       | := | Framed-User         |
|  2 | testgroup | Framed-Protocol    | := | PPP                 |
|  3 | testgroup | Framed-Compression | := | Van-Jacobsen-TCP-IP |
+----+-----------+--------------------+----+---------------------+</pre>
<h4><strong>Step 09</strong> — Ok. Finally lets verify the configured user using a &#8220;radclient&#8221; command</h4>
<pre># echo "User-Name=testuser,User-Password=testpassword" | radclient 127.0.0.1:1812 auth mysecret</pre>
<pre>Sent Access-Request Id 65 from 0.0.0.0:43879 to 172.17.0.55:1812 length 48
Received Access-Accept Id 65 from 172.17.0.55:1812 to 0.0.0.0:0 length 38</pre>
<p>Congradulations.! you have now working RADIUS service.</p>
<p>In order to run the service in background</p>
<pre># systemctl start freeradius
# systemctl enable freeradius</pre>
<h4><em><strong>&#8220;I hope this has been informative&#8221;</strong></em></h4>
<p>The post <a rel="nofollow" href="https://www.osradar.com/freeradius-with-mysql-backend/">FreeRadius with mysql Backend</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/freeradius-with-mysql-backend/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Setup VPN access provisioning server on top of Ubuntu 18.04</title>
		<link>https://www.osradar.com/setup-vpn-access-provisioning-server-on-top-of-ubuntu-18-04/</link>
					<comments>https://www.osradar.com/setup-vpn-access-provisioning-server-on-top-of-ubuntu-18-04/#respond</comments>
		
		<dc:creator><![CDATA[osradar_editor]]></dc:creator>
		<pubDate>Thu, 14 Feb 2019 09:19:24 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[openvpn]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=10692</guid>

					<description><![CDATA[<p>If you are looking for a solution that helps others to route their systems traffic via our local gateway(ISP) which acting like a proxy, then here is a free solution. This is called Virtual Private Networking (VPN) and once  users are connected, they have been assigned a private network which then ultimately enforce routing their [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/setup-vpn-access-provisioning-server-on-top-of-ubuntu-18-04/">Setup VPN access provisioning server on top of Ubuntu 18.04</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you are looking for a solution that helps others to route their systems traffic via our local gateway(ISP) which acting like a proxy, then here is a free solution. This is called Virtual Private Networking (VPN) and once  users are connected, they have been assigned a private network which then ultimately enforce routing their local traffic via our VPN server to the actual destination. Of course, there are different use-cases people might look to achieve by deploying a VPN service and some of them are;</p>
<ul>
<li>Encrypt outgoing traffic</li>
<li>Possible of traffic routing other than your local ISP</li>
</ul>
<h3>Getting Started</h3>
<p>01. Installing the required packages</p>
<pre class=""># apt-get update &amp;&amp; apt-get install -y openvpn easy-rsa</pre>
<p>02. Creating additional directory for hosting certificate which we later introduce</p>
<pre class=""># mkdir -p /etc/openvpn/server/certs</pre>
<pre class=""># cd /etc/openvpn/server/certs</pre>
<p>03. Build a CA &amp; its Keys</p>
<pre class=""># openssl genrsa -out ca.key 2048</pre>
<pre class=""># openssl req -new -x509 -days 3650 -key ca.key -out ca.crt


Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:la 
Locality Name (eg, city) []:la
Organization Name (eg, company) [Internet Widgits Pty Ltd]:osradar
Organizational Unit Name (eg, section) []:it
Common Name (e.g. server FQDN or YOUR name) []:vpn-server.osradar.com
Email Address []:</pre>
<p>04. Lets generate our VPN service own certificates &amp; Keys</p>
<pre class="lang:sh decode:true"># openssl genrsa -out vpn.key 2048</pre>
<pre class="lang:sh decode:true"># openssl req -new -key vpn.key -out vpn.csr

Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:la
Locality Name (eg, city) []:la
Organization Name (eg, company) [Internet Widgits Pty Ltd]:osradar
Organizational Unit Name (eg, section) []:it
Common Name (e.g. server FQDN or YOUR name) []:vpn-server.osradar.com
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
</pre>
<pre class="lang:sh decode:true"># openssl x509 -req -in vpn.csr -out vpn.crt -CA ca.crt -CAkey ca.key -CAcreateserial -days 365

Signature ok
subject=C = US, ST = la, L = la, O = osradar, OU = it, CN = vpn-server.osradar.com</pre>
<pre class=""># openssl dhparam -out dh2048.pem 2048</pre>
<p>05. Configuring the Open VPN server</p>
<pre class="lang:sh decode:true"># vim /etc/openvpn/server/server.conf

port 443    
proto tcp    
dev tun    
server 10.11.0.0 255.255.255.0    
ca /etc/openvpn/server/keys/ca.crt    
cert /etc/openvpn/server/certs/vpn.crt    
key /etc/openvpn/server/certs/vpn.key    
dh /etc/openvpn/server/certs/dh2048.pem  
persist-key    
persist-tun    
keepalive 10 60    
reneg-sec 0    
comp-lzo    
tun-mtu 1468    
tun-mtu-extra 32    
mssfix 1400    
push "persist-key"    
push "persist-tun"    
push "redirect-gateway def1"    
push "dhcp-option DNS 8.8.8.8"    
push "dhcp-option DNS 8.8.4.4"    
status /etc/openvpn/443.log    
verb 3</pre>
<p>06. Starting up the service</p>
<pre class=""># systemctl start openvpn@server</pre>
<p>07. Enable IPV4 routing between interfaces</p>
<pre class=""># vim /etc/sysctl.d/60-ipv4-forward.conf

net.ipv4.ip_forward=1</pre>
<pre class=""># sysctl -p /etc/sysctl.d/60-ipv4-forward.conf</pre>
<p>08. Changing the firewall rules</p>
<pre class=""># vim /etc/ufw/before.rules

# START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 10.8.0.0/16 -o main_nic -j MASQUERADE
COMMIT
# END OPENVPN RULES</pre>
<p><strong>main_nic</strong> =&gt; replace this with your outgoing NIC device name</p>
<p>Allow 443/tcp which we setup our VPN service</p>
<pre class=""># ufw allow 443/tcp
# ufw disable
# ufw enable
</pre>
<p>09. Prepare user certificate. In the example below, I assume the username is bob.</p>
<pre class=""># openssl genrsa -out bob.key 2048</pre>
<pre class="lang:sh decode:true"># openssl req -new -key bob.key -out bob.csr

You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:LK
State or Province Name (full name) [Some-State]:CMB
Locality Name (eg, city) []:colombo
Organization Name (eg, company) [Internet Widgits Pty Ltd]:private
Organizational Unit Name (eg, section) []:it
Common Name (e.g. server FQDN or YOUR name) []:bob
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:</pre>
<p>&nbsp;</p>
<p>10. Sign the user certificate using the CA certificate which we generated at step 03.</p>
<pre class=""># openssl x509 -req -in bob.csr -out bob.crt -CA ca.crt -CAkey ca.key -CAcreateserial -days 365</pre>
<p><strong>bob.crt</strong> should be shared with the user in order to them to launch OpenVPN client from their work-station.</p>
<h3>Client Work-Station End.</h3>
<p>11. Open the terminal and install the the required packages and then launch &#8220;nm-connection-editor&#8221;</p>
<pre class=""># apt-get update &amp;&amp; apt-get install -y network-manager-openvpn</pre>
<pre class="">$ nm-connection-editor</pre>
<p>&nbsp;</p>
<p>12. Setting up the VPN client profile</p>
<p>Click (+) Sign and then Select the OpenVPN option under the drop-down menu</p>
<p><img loading="lazy" class="alignnone wp-image-10783 size-full" src="https://www.osradar.com/wp-content/uploads/2019/02/vpn1-e1550055358692.png" alt="" width="456" height="528" srcset="https://www.osradar.com/wp-content/uploads/2019/02/vpn1-e1550055358692.png 456w, https://www.osradar.com/wp-content/uploads/2019/02/vpn1-e1550055358692-259x300.png 259w, https://www.osradar.com/wp-content/uploads/2019/02/vpn1-e1550055358692-363x420.png 363w" sizes="(max-width: 456px) 100vw, 456px" /> <img loading="lazy" class="alignnone size-full wp-image-10784" src="https://www.osradar.com/wp-content/uploads/2019/02/vn2-e1550055316217.png" alt="" width="648" height="539" srcset="https://www.osradar.com/wp-content/uploads/2019/02/vn2-e1550055316217.png 648w, https://www.osradar.com/wp-content/uploads/2019/02/vn2-e1550055316217-300x250.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/vn2-e1550055316217-505x420.png 505w" sizes="(max-width: 648px) 100vw, 648px" /></p>
<p>&nbsp;</p>
<p>That&#8217;s it. Now you can start newly created VPN connection which then initiate a encrypted tunnel between local station to the destination VPN server. <img loading="lazy" class="alignnone size-full wp-image-10810" src="https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-14_12-46-15-e1550132000268.png" alt="" width="372" height="117" srcset="https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-14_12-46-15-e1550132000268.png 372w, https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-14_12-46-15-e1550132000268-300x94.png 300w" sizes="(max-width: 372px) 100vw, 372px" /></p>
<p>You can verify the result by looking at the IP address space</p>
<pre class=""># ip addr show</pre>
<p><img loading="lazy" class="alignnone size-full wp-image-10814" src="https://www.osradar.com/wp-content/uploads/2019/02/ipshow.png" alt="" width="923" height="98" srcset="https://www.osradar.com/wp-content/uploads/2019/02/ipshow.png 923w, https://www.osradar.com/wp-content/uploads/2019/02/ipshow-300x32.png 300w, https://www.osradar.com/wp-content/uploads/2019/02/ipshow-768x82.png 768w, https://www.osradar.com/wp-content/uploads/2019/02/ipshow-696x74.png 696w" sizes="(max-width: 923px) 100vw, 923px" /></p>
<p><em><strong>&#8220;I hope this has been informative&#8221;</strong></em></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/setup-vpn-access-provisioning-server-on-top-of-ubuntu-18-04/">Setup VPN access provisioning server on top of Ubuntu 18.04</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/setup-vpn-access-provisioning-server-on-top-of-ubuntu-18-04/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Join CentOS7 system into Windows Domain</title>
		<link>https://www.osradar.com/join-centos7-system-into-windows-domain/</link>
					<comments>https://www.osradar.com/join-centos7-system-into-windows-domain/#respond</comments>
		
		<dc:creator><![CDATA[osradar_editor]]></dc:creator>
		<pubDate>Mon, 11 Feb 2019 09:54:42 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Centos7]]></category>
		<category><![CDATA[Windows Active Directory]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=10675</guid>

					<description><![CDATA[<p>Why? That&#8217;s a good question. Why? That&#8217;s because then it allows us to authenticate users centrally whom already has Windows Active Directory user accounts. This really comes handy as we then don&#8217;t need to provision CentOS local user account as new users are in demand for server access. Think about a scenario, for example, a [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/join-centos7-system-into-windows-domain/">Join CentOS7 system into Windows Domain</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Why?<br />
That&#8217;s a good question. Why? That&#8217;s because then it allows us to authenticate users centrally whom already has Windows Active Directory user accounts. This really comes handy as we then don&#8217;t need to provision CentOS local user account as new users are in demand for server access. Think about a scenario, for example, a company whose having thousands of users who wish to have server access for  system administration. That would be a pain in the neck if our plan to setup each individual accounts locally. Problem even get started to worse if the server count increase over the time. Thus, having your LInux systems&#8217;s authentication over Windows Active Directory should be one of the obvious solutions.</p>
<h3>Getting Started</h3>
<p>This tutorial is based on the following configuration:</p>
<ul>
<li>domain name : osradar.com</li>
<li>workgroup : OSRADAR</li>
<li>kerberos realm : OSRADAR.COM</li>
<li>Winsdows AD IP address: 172.17.0.51</li>
<li>Windows AS DNS name: windows-ad.osradar.com</li>
<li>a valid user called &#8220;winaduser01&#8221; already existed at Windows AD.</li>
</ul>
<p>01. Install packages</p>
<pre class=""># yum install krb5-workstation pam_krb5 samba samba-client samba-winbind authconfig</pre>
<p>&nbsp;</p>
<p>02. Ensure that the clocks on both systems are in sync. Time synchronization is essential for Kerberos to work.</p>
<p>03. To have working DNS resolution, point all Linux client systems to Windows AD &#8211; Essential for Kerberos to work. Optionally, you can also work with /etc/hosts if required.</p>
<pre class=""># vim /etc/hosts

172.17.0.51 windows-ad.osradar.com</pre>
<p>04. Configure Kerberos to use AD Kerberos realm.</p>
<pre class="lang:sh decode:true"># vi /etc/krb5.conf

[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log

[libdefaults]
dns_lookup_realm = true
dns_lookup_kdc = true

ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
default_realm = OSRADAR.COM
default_ccache_name = KEYRING:persistent:%{uid}

[realms]
OSRADAR.COM = {
kdc = 172.17.0.51
admin_server = 172.17.0.51
}
</pre>
<p>&nbsp;</p>
<p>05. Verify Kerberos operation &#8211; (Assume following winaduser01 exist on the Windows AD)</p>
<pre class=""># kinit winaduser01
Password for winaduser01@OSRADAR.COM:</pre>
<p>(This of course is to get a Kerberos Ticket for our Linux client system)</p>
<pre class=""># klist

Ticket cache: FILE:/tmp/krb5cc_0
Default principal: winaduser01@OSRADAR.COM
Valid starting Expires Service principal
04/27/2019 00:42:19 04/27/2019 10:42:19 krbtgt/OSRADAR.COM@OSRADAR.COM
renew until 05/04/2019 00:42:10</pre>
<p>(To list whether do we have valid Kerberos Tickets now..)</p>
<pre class=""># kdestroy</pre>
<p>(Optionally, if you want to remove the existing Kerberos Ticket)</p>
<p>&nbsp;</p>
<p>06. Configure Samba to connect to AD server.</p>
<pre class="lang:sh decode:true "># vi /etc/samba/smb.conf

[global]
workgroup = OSRADAR
realm = OSRADAR.COM
security = ads
idmap config * : range = 16777216-33554431
winbind separator = +
template homedir = /home/%U
template shell = /bin/bash
kerberos method = secrets only
winbind use default domain = true
winbind offline logon = true

server string = Samba Server Version %v
netbios name = MYLINUXPC1
interfaces = lo ens9 172.17.0.0/24
hosts allow = 127. 172.17.0.
passdb backend = tdbsam
winbind enum users = yes
winbind enum groups = yes
client use spnego = yes
client ntlmv2 auth = yes
encrypt passwords = yes
idmap config MYCOMPANY:backend = rid
idmap config MYCOMPANY:range = 10000000-1999999</pre>
<p>&nbsp;</p>
<p>07. Check for configuration errors if present.</p>
<pre class=""># testparm</pre>
<p>&nbsp;</p>
<p>08. Configure NSS and PAM to use winbind for system authentication</p>
<pre class=""># authconfig --enablewinbind --enablewins --enablewinbindauth --update</pre>
<p>&nbsp;</p>
<p>09. Service Restarts</p>
<pre class=""># systemctl restart smb
# systemctl restart winbind</pre>
<p>&nbsp;</p>
<p>10. Lets add our linux client machine to the Winsows AD Domain</p>
<pre class=""># kinit winaduser01</pre>
<pre class=""># net ads join -U winaduser01
Enter winaduser's password:
Joined 'MYLINUXPC1' to dns domain 'OSRADAR.COM'</pre>
<p>&nbsp;</p>
<p>Congratulations. If you see the above message, it confirms that your Linux system is correctly joined with WIndows. Now, you can perform any user authentication against any user who has a valid account on windows Active Directory.</p>
<p>Optionally, if you want to leave the joined domains</p>
<pre class=""># net ads leave -U winaduser01</pre>
<p>&nbsp;</p>
<p><em><strong>&#8220;I hope this has been informative for you..&#8221;</strong></em></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/join-centos7-system-into-windows-domain/">Join CentOS7 system into Windows Domain</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/join-centos7-system-into-windows-domain/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Setting up OpenLdap and phpldapadmin</title>
		<link>https://www.osradar.com/setting-up-openldap-and-phpldapadmin/</link>
					<comments>https://www.osradar.com/setting-up-openldap-and-phpldapadmin/#respond</comments>
		
		<dc:creator><![CDATA[osradar_editor]]></dc:creator>
		<pubDate>Fri, 08 Feb 2019 08:12:02 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[LDAP]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=10503</guid>

					<description><![CDATA[<p>What? Let me start the post saying that OpenLdap is a yet another Linux service which build on top of the LDAP protocol ( Lightweight Directory Access Protocol). But it is a free, unlike Windows Active Directory which is another product that build on top of LDAP. Why? There could be different use cases that [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/setting-up-openldap-and-phpldapadmin/">Setting up OpenLdap and phpldapadmin</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>What?<br />
Let me start the post saying that OpenLdap is a yet another Linux service which build on top of the LDAP protocol ( Lightweight Directory Access Protocol). But it is a free, unlike Windows Active Directory which is another product that build on top of LDAP.</p>
<p>Why?<br />
There could be different use cases that people use LDAP, but most often one of the best outcome we generally see is the benefit of maintaining a user account administrations for user account authentication. However, It just not store user password credential, but also other account specific information such as UID, GID, home-directory, Telephone numbers, other associate groups and etc.</p>
<p>phpLdapAdmin:<br />
On the other hand, phpldapadmin is just a web based application that provide graphical user interface to interact with LDAP. It builds on top of PHP and by default Apache will host the application, so that users can access the interface via their favorite browsers.</p>
<p>&nbsp;</p>
<h3><strong>Getting Started</strong>.</h3>
<p>01. Install the required packages.</p>
<pre class=""># yum install -y openldap openldap-clients openldap-servers</pre>
<p>&nbsp;</p>
<p>02. Generate root LDAP password</p>
<pre class="lang:sh decode:true "># slappasswd -s osradar -n

{SSHA}FJbfOwcgwKPpRwmZH23h3QvyK4bs3Nbj[root@localhost ~]#</pre>
<p class="">You will have a similar above output, and then the root password for the Ldap will be;<br />
<strong>{SSHA}FJbfOwcgwKPpRwmZH23h3QvyK4bs3Nbj</strong></p>
<p>&nbsp;</p>
<p>03. Next, create a TLS certificate to be used by LDAP server</p>
<pre class="lang:sh decode:true "># openssl req -new -x509 -nodes -out /etc/openldap/certs/cert.pem \
-keyout /etc/openldap/certs/priv.pem -days 365

Generating a 2048 bit RSA private key
...........................................................................................................................................................+++
.........................+++
writing new private key to '/etc/openldap/certs/priv.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:LK
State or Province Name (full name) []:CMB
Locality Name (eg, city) [Default City]:colombo
Organization Name (eg, company) [Default Company Ltd]:osradar
Organizational Unit Name (eg, section) []:it
Common Name (eg, your name or your server's hostname) []:ldap-server.osradar.com
Email Address []:</pre>
<p>&nbsp;</p>
<p>04. Now, its time to initialize the LDAP database. First, you need to copy given example schema to a another working directory</p>
<pre class="lang:sh decode:true"># cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG</pre>
<p>&nbsp;</p>
<p>05. Generating DB files</p>
<pre class="lang:sh decode:true "># slaptest

5c5c5740 hdb_db_open: database "dc=my-domain,dc=com": db_open(/var/lib/ldap/id2entry.bdb) failed: No such file or directory (2).
5c5c5740 backend_startup_one (type=hdb, suffix="dc=my-domain,dc=com"): bi_db_open failed! (2)
slap_startup failed (test would succeed using the -u switch)</pre>
<p>Dont worry about the errors.</p>
<p>&nbsp;</p>
<p>06. Next, go into the directory where we generate the Certificate in above step. Then apply basic security.</p>
<pre class="lang:sh decode:true "># cd /etc/openldap/certs
# chown ldap:ldap *
# chmod 600 priv.pem
# chown ldap:ldap /var/lib/ldap/*</pre>
<p>&nbsp;</p>
<p>07. Starting up the server</p>
<pre class=""># systemctl start slapd.service</pre>
<p>&nbsp;</p>
<p>08. Check the network socket is up &amp; running</p>
<pre class="lang:sh decode:true"># ss -lnt
State       Recv-Q Send-Q                      Local Address:Port                                     Peer Address:Port                             
LISTEN      0      128                                    :::389                                                :::*</pre>
<p>NOTE the 389/tcp which is the default for LDAP server.</p>
<p>&nbsp;</p>
<p>09.  Generate <strong>cosine</strong> &amp; <strong>nis</strong> LDAP schemas:</p>
<pre class="lang:sh decode:true "># cd /etc/openldap/schema

# ldapadd -Y EXTERNAL -H ldapi:/// -D "cn=config" -f cosine.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=cosine,cn=schema,cn=config"

# ldapadd -Y EXTERNAL -H ldapi:/// -D "cn=config" -f nis.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=nis,cn=schema,cn=config"</pre>
<p>&nbsp;</p>
<p>10. Its time to add the details that govern our LDAP service. You should take a note on the domain because LDAP always binds to a domain once built.</p>
<pre class="lang:sh decode:true "># vim /etc/openldap/changes.ldif

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcSuffix
olcSuffix: dc=osradar,dc=com

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootDN
olcRootDN: cn=Manager,dc=osradar,dc=com

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootPW
olcRootPW: {SSHA}FJbfOwcgwKPpRwmZH23h3QvyK4bs3Nbj

dn: cn=config
changetype: modify
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/openldap/certs/cert.pem
-
replace: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/openldap/certs/priv.pem

dn: cn=config
changetype: modify
replace: olcLogLevel
olcLogLevel: -1

dn: olcDatabase={1}monitor,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" read by dn.base="cn=Manager,dc=osradar,dc=com" read by * none</pre>
<p><strong>olcRootPW</strong> =&gt; should be replace with the password that we generated at step 02<br />
<strong>dc=osradar,dc=com</strong> =&gt; should be replace with the domain you want the LDAP to be in</p>
<p>&nbsp;</p>
<p>11. Apply the changes to LDAP server</p>
<pre class="lang:sh decode:true "># ldapmodify -Y EXTERNAL -H ldapi:/// -f /etc/openldap/changes.ldif

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "olcDatabase={2}hdb,cn=config"
modifying entry "olcDatabase={2}hdb,cn=config"
modifying entry "olcDatabase={2}hdb,cn=config"
modifying entry "cn=config"
modifying entry "cn=config"
modifying entry "olcDatabase={1}monitor,cn=config"</pre>
<p>&nbsp;</p>
<p>12. Finally, we will need to setup a base to work with LDAP service. So, first create a file with enough details.</p>
<pre class="lang:sh decode:true"># vim  /etc/openldap/base.ldif 

dn: dc=osradar,dc=com
dc: osradar
objectClass: top
objectClass: domain

dn: ou=adminGroup,dc=osradar,dc=com
ou: adminGroup
objectClass: top
objectClass: organizationalUnit</pre>
<p>&nbsp;</p>
<p>13. Apply the changes now via &#8216;ldapadd&#8217; command</p>
<pre class="lang:sh decode:true"># ldapadd -x -w osradar -D cn=Manager,dc=osradar,dc=com -f /etc/openldap/base.ldif
</pre>
<p>&nbsp;</p>
<p>14. Restart the LDAP service</p>
<pre class=""># systemctl restart slapd.service</pre>
<p>&nbsp;</p>
<h3><strong>Setup phpLdapAdmin:</strong></h3>
<p>15. Install apache and php</p>
<pre class="lang:sh decode:true">yum -y install httpdphp php-mbstring php-pear</pre>
<p>&nbsp;</p>
<p>16. Change the main apache configuration</p>
<pre class="lang:sh decode:true"># vim etc/httpd/conf/httpd.conf

ServerAdmin root@srv.world
ServerName www.srv.world:80
AllowOverride All
DirectoryIndex index.html index.cgi index.php
</pre>
<p><strong>Note</strong>: the required changes line are at line numbers 86, 95, 151 and 164 respectively.</p>
<p>&nbsp;</p>
<p>17. Install &#8220;phpldapadmin&#8221;. (For this we will have to add new repository call &#8220;epel&#8221;)</p>
<pre class="lang:sh decode:true"># yum install -y epel-release
# yum install -y phpldapadmin</pre>
<p>&nbsp;</p>
<p>18. Changing the default settings</p>
<pre class="lang:sh decode:true"># vim /etc/phpldapadmin/config.php

$servers-&gt;setValue('login','attr','dn');
// $servers-&gt;setValue('login','attr','uid');
</pre>
<p>The above changes are in line numbers 397 to 398</p>
<p>&nbsp;</p>
<p>19. Lets change the default VirtualHost  that is coming under phpldapadmin</p>
<pre class="lang:sh decode:true"># vim /etc/httpd/conf.d/phpldapadmin.conf

Require all granted</pre>
<p>The change suppose to happen at line number 11</p>
<p>&nbsp;</p>
<p>That&#8217;s it for setting up &#8220;phpldapadmin&#8221;. Make sure you enable the required firewall configuration. That&#8217;s being done, let go ahead and visit our newly setup phpLDAPAdmin interface.<br />
http://{ip address of the server}/ldapadmin</p>
<p><img loading="lazy" class="alignnone size-full wp-image-10591" src="https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-07_22-47-56.png" alt="" width="664" height="276" srcset="https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-07_22-47-56.png 664w, https://www.osradar.com/wp-content/uploads/2019/02/Screenshot_2019-02-07_22-47-56-300x125.png 300w" sizes="(max-width: 664px) 100vw, 664px" /></p>
<p>To login, you will have to provide the<br />
&#8211; <strong>Login DN</strong>: cn=Manager,dc=osradar,dc=com<br />
&#8211; <strong>Password</strong>: in our case, it is &#8220;osradar&#8221; which we given at step 02 of the</p>
<p><em>&#8220;If you come up to this far, congratulations.. you have now your working LDAP service.&#8221;</em></p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/setting-up-openldap-and-phpldapadmin/">Setting up OpenLdap and phpldapadmin</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/setting-up-openldap-and-phpldapadmin/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
