<?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>/home/jeevanullas &#187; Linux</title>
	<atom:link href="http://jeevanullas.in/blog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://jeevanullas.in/blog</link>
	<description>Life of a geek</description>
	<lastBuildDate>Wed, 11 Aug 2010 13:17:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Connecting to Amazon Virtual Private Cloud using Linux</title>
		<link>http://jeevanullas.in/blog/2010/08/connecting-to-amazon-virtual-private-cloud-using-linux/</link>
		<comments>http://jeevanullas.in/blog/2010/08/connecting-to-amazon-virtual-private-cloud-using-linux/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 08:29:00 +0000</pubDate>
		<dc:creator>jeevanullas</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[VPC]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://jeevanullas.in/blog/?p=142</guid>
		<description><![CDATA[Hello internet, I am trying to connect my Linux machine to Amazon VPC using end to end IPSec tunnel. I have set all the required VPC objects on Amazon side and now plan to set my Linux Laptop as a VPN gateway. But the only doubt I have is that my Laptop is behind NAT. [...]]]></description>
			<content:encoded><![CDATA[<p>Hello internet,</p>
<p>I am trying to connect my Linux machine to Amazon VPC using end to end IPSec tunnel. I have set all the required VPC objects on Amazon side and now plan to set my Linux Laptop as a VPN gateway. But the only doubt I have is that my Laptop is behind NAT. Though I have opened and re-directed the necessary ports on my NAT device I am not sure if this thing is going to work.</p>
<p>Please let me know if this setup can work. I am trying to follow the following guide </p>
<p><a href="http://openfoo.org/blog/amazon_vpc_with_linux.html">http://openfoo.org/blog/amazon_vpc_with_linux.html</a></p>
<p>From what I understand so far in order to make this guide work for my setup I need to do some extra configuration. I have also found out that IPSec supports tunnels behind NAT devices but I am not sure if Amazon VPC will support such configuration.</p>
<p>Any help in this matter is highly appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeevanullas.in/blog/2010/08/connecting-to-amazon-virtual-private-cloud-using-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Boxgrinder to build your own AMI for EC2</title>
		<link>http://jeevanullas.in/blog/2010/08/using-boxgrinder-to-build-your-own-ami-for-ec2/</link>
		<comments>http://jeevanullas.in/blog/2010/08/using-boxgrinder-to-build-your-own-ami-for-ec2/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 10:31:05 +0000</pubDate>
		<dc:creator>jeevanullas</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[ec2]]></category>

		<guid isPermaLink="false">http://jeevanullas.in/blog/?p=131</guid>
		<description><![CDATA[In my last article I showed on how to create your own AMI for EC2. The article basically demonstrated the whole process been done manually by executing commands. In this article I would like to cover Boxgrinder which reduces the manual effort completely and helps you get your own AMI registered on EC2 and in [...]]]></description>
			<content:encoded><![CDATA[<p>In my last <a href="http://jeevanullas.in/blog/2010/08/creating-your-own-ami-for-amazon-ec2/">article</a> I showed on how to create your own AMI for EC2. The article basically demonstrated the whole process been done manually by executing commands. In this article I would like to cover <a href="http://www.jboss.org/stormgrind/projects/boxgrinder.html">Boxgrinder</a> which reduces the manual effort completely and helps you get your own AMI registered on EC2 and in few minutes.</p>
<p>First thing is that we need to run boxgrinder on CentOS if we would like to build a CentOS AMI and on Fedora if we would like to build a Fedora AMI. The good thing about boxgrinder is that it uses the latest <a href="http://cloudpress.org/2010/07/21/boxgrinder-build-0-5-0-release-with-fedora-13-on-ec2-support-and-stormfolio-update/">pvgrub</a> kernel images provided by Amazon which basically lets you boot into your own kernel. So gone are the days when we had to use Amazon EC2 kernel. Thanks to <a href="http://twitter.com/marekgoldmann">Marek Goldmann</a> for making this possible in boxgrinder 0.5</p>
<p>Without wasting much time let&#8217;s get started. I am going to build a Fedora 13 AMI for EC2 in this article but you can do the same stuff using CentOS. First of all we will have to install some required packages which are basically the dependencies.</p>
<pre>
# yum -y install git parted wget rpmdevtools appliance-tools \
sudo libguestfs ruby  rubygems ruby-libguestfs guestfish \
 yum-utils e2fsprogs
</pre>
<p>Next we need to install the EC2 AMI tools </p>
<pre>
#  rpm -Uvh http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.noarch.rpm
</pre>
<p>Then we need to install couple of gems for boxgrinder which will let us build a AMI for EC2. The following are the gems</p>
<pre>
# gem install boxgrinder-build
# gem install boxgrinder-build-fedora-os-plugin
# gem install boxgrinder-build-ec2-platform-plugin
# gem install boxgrinder-build-s3-delivery-plugin
</pre>
<p>Now we need to create a appliance definition file which will be used to build our AMI. This file is basically written in <a href="http://www.yaml.org/">YAML</a> format. The following is the file which I used:</p>
<pre>
name: Fedora13EC2
summary: My Fedora on EC2
os:
 name: fedora
 version: 13
hardware:
 partitions:
   "/":
     size: 2
packages:
 includes:
   - bash
   - kernel-PAE
   - grub
   - e2fsprogs
   - passwd
   - policycoreutils
   - chkconfig
   - rootfiles
   - yum
   - vim-minimal
   - acpid
   - dhclient
   - iputils
   - openssh-server
   - openssh-clients
   - httpd
   - system-config-firewall-base
</pre>
<p>Save this file in a directory appliances/ with the name Fedora13EC2.appl. Now we need to create a file which will store our AWS credentials and other important paths to certificate and private key. These are required by boxgrinder to put the image in S3 and register it with EC2.</p>
<pre>
# vi $HOME/.boxgrinder/plugins/s3
access_key: yourawsaccesskey                        # required
secret_access_key: youawssecretkey             # required
bucket: myownfedora-box                               # required
account_number: youramazonaccountnumber  # required
path: /mnt/images                                 # default: /
cert_file: /root/.ec2/yourcertificate.pem   # required only for ami type
key_file: /root/.ec2/yourprivatekey.pem  # required only for ami type
</pre>
<p>We need to create the directory /mnt/images which will store the AMI.</p>
<pre>
# mkdir /mnt/images
</pre>
<p>Finally we can fire boxgrinder to build the AMI.</p>
<pre>
# boxgrinder-build appliances/Fedora13EC2.appl -p ec2 -d ami
</pre>
<p>It will run for few minutes and will end up with something like:</p>
<p>I, [2010-08-07T06:21:58.693095 #17381]  INFO &#8212; : Image successfully registered under id: ami-<youramiid></p>
<p>That&#8217;s it. So simple right? Now you run this AMI and enjoy !</p>
<p>I would like to encourage people to look into this project. This is really awesome. For more information you can go through the following links<br />
<a href="http://community.jboss.org/wiki/BoxGrinderBuildPluginsDeliveryS3">http://community.jboss.org/wiki/BoxGrinderBuildPluginsDeliveryS3</a><br />
<a href="http://community.jboss.org/wiki/BoxGrinderApplianceDefinitionFiles">http://community.jboss.org/wiki/BoxGrinderApplianceDefinitionFiles</a><br />
<a href="http://community.jboss.org/docs/DOC-14384">http://community.jboss.org/docs/DOC-14384</a><br />
<a href="http://cloudpress.org/2010/07/21/boxgrinder-build-0-5-0-release-with-fedora-13-on-ec2-support-and-stormfolio-update/">http://cloudpress.org/2010/07/21/boxgrinder-build-0-5-0-release-with-fedora-13-on-ec2-support-and-stormfolio-update/</a><br />
<a href="http://cloudpress.org/2010/06/24/judcon-2010-boston-slides/">http://cloudpress.org/2010/06/24/judcon-2010-boston-slides/</a></p>
<p>In my next post I will cover my experience with passing user data scripts to EC2 AMI while starting the instance and much more to come. Happy hacking <img src='http://jeevanullas.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://jeevanullas.in/blog/2010/08/using-boxgrinder-to-build-your-own-ami-for-ec2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fedora 13 release party in Bangalore</title>
		<link>http://jeevanullas.in/blog/2010/06/fedora-13-release-party-in-bangalore/</link>
		<comments>http://jeevanullas.in/blog/2010/06/fedora-13-release-party-in-bangalore/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 10:48:54 +0000</pubDate>
		<dc:creator>jeevanullas</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://jeevanullas.in/blog/?p=86</guid>
		<description><![CDATA[I am a little late on writing about the release party we had last week on Saturday, was occupied with $work.  Well it all started with the mail of Rangeen to FSUG mailing list. That time I have just come to Bangalore and thought it will be great to meet all the Fedora folks in [...]]]></description>
			<content:encoded><![CDATA[<p>I am a little <a href="http://dodoincfedora.wordpress.com/2010/06/05/fedora-13-release-party-with-fsmk-in-bengaluru/">late</a> on writing about the release party we had last week on Saturday, was occupied with <a href="http://www.infosys.com">$work</a>.  Well it all started with the mail of <a href="https://fedoraproject.org/wiki/User:Sherry151">Rangeen</a> to <a href="http://lists.fsmk.in/private.cgi/fsmk-discuss-fsmk.in/2010-May/000449.html">FSUG</a> mailing list. That time I have just come to Bangalore and thought it will be great to meet all the Fedora folks in Bangalore during such party. Venue was a big issue initially as almost all the colleges in Bangalore were having exams. But I knew my friend <a href="http://www.facebook.com/saket.srivastav">Saket</a> who has been pretty active in <a href="http://fsmk.org">FSMK</a> Bangalore. I contacted him and asked him if we can organize this release party at FSMK Bangalore office. I got a positive reply and after confirmation from the FSMK folks we <a href="http://lists.fsmk.in/private.cgi/fsmk-discuss-fsmk.in/2010-June/000475.html">finalized </a>to have it at FSMK Bangalore office on June 5th.</p>
<p>I personally never expected many folks to turn up because of two reasons. One been that many colleges in Bangalore were having end semester exams plus we don&#8217;t have much Fedora folks here in Bangalore. Initially we (<a href="https://fedoraproject.org/wiki/User:Deepsa">Me</a>, <a href="https://fedoraproject.org/wiki/User:Ankursinha">Ankur</a>, <a href="https://fedoraproject.org/wiki/User:Hiemanshu">Hiemanshu</a> , <a href="http://twitter.com/dipjyotighosh">Dipjyoti</a> and <a href="https://fedoraproject.org/wiki/User:Sherry151">Rangeen</a>) had a hard time finding out the office. Point to remember GPS in India will not be accurate enough with all these narrow lanes everywhere.</p>
<p>Finally we found the place and till then FSMK folks also started turning up. I would like to specially mention Vignesh, Prabodh and Naveen from FSMK core team who turned up for the party and assisted with the logistics. We had few other people some friends of <a href="https://fedoraproject.org/wiki/User:Sherry151">Rangeen</a> , students of Prabodh&#8217;s previous college <a href="http://cmrit.cmredu.com/">CMRIT</a> and other FSMK members.</p>
<p>We started with the discussion about why people should use Linux and not Windows. I never expected to start with such discussion in a Fedora release party but I love to be part of such discussion. It was great. Many questions were thrown on us. Why Linux? Linux? Is it user friendly enough? Why would a normal user plan to switch to Linux? People there who were using Fedora for past 4 years had such questions. I respect all the points given by them.</p>
<p>We started answering one by one. Inputs were given by Naveen on how the current scenario is changing and government bodies across India are encouraging FOSS in schools and engineering colleges. The current projects by Knowledge Commons and MHRD were been discussed with all the participants.</p>
<p>Me and Rangeen told the participants about how things (hardware) works out of the box these days with Fedora. How easily if you plug a mobile broadband card you can be sure that it will work without any hassle (all thanks to the great NetworkManager). We discussed why latest hardware sometime doesn&#8217;t work on most of the Linux distributions and how things are now changing. Times have changed and we should look towards improving things instead of blaming about them (my personal opinion).</p>
<p>Naveen introduced us to the FSMK activities currently going on. I personally got to know lot from that and looking forward to contribute to the cause FSMK is supporting.</p>
<p>While the hot discussion on various topics related to Linux/Windows was going on we ordered pizza&#8217;s for all of us. I would like to mention here how happy was the pizza girl over phone that she told me to not pick her phone after few minutes. She loved my Kannada ring tone <img src='http://jeevanullas.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Once the dust of doubts and questions settled down <a href="https://fedoraproject.org/wiki/User:Ankursinha">Ankur</a> started giving the Fedora 13 DVD/Live CD media to all the members. We also copied ISO for others who brought USB stick. I personally got DVD 32bit ISO from Ankur. Thanks a lot Ankur because I am writing this blog post from a Fedora 13 loaded laptop  <img src='http://jeevanullas.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>After that we briefly discussed the new features in Fedora 13 among the participants and touched few special points from the release notes handouts given to them by Ankur and <a href="https://fedoraproject.org/wiki/User:Sherry151">Rangeen</a></p>
<p>Pizzas had arrived by that time and we ate them all!! It was great having pizza and garlic bread-sticks with jalapeño. Finally we all exchanged our phone numbers and promised to stay in touch <img src='http://jeevanullas.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Overall turn out was around 10 + we four Fedora folks (<a href="https://fedoraproject.org/wiki/User:Deepsa">Me</a>, <a href="https://fedoraproject.org/wiki/User:Sherry151">Rangeen</a>, <a href="https://fedoraproject.org/wiki/User:Hiemanshu">Hiemanshu</a> and <a href="https://fedoraproject.org/wiki/User:Ankursinha">Ankur</a>). That was a good figure. We have now aligned ourself with the FSMK and we plan to conduct some good workshops as soon as the college re-opens in Bangalore. Fedora is going to spread everywhere in the air of Bangalore I am sure. We are looking for contributors and FSMK is also planning their strategy on the same grounds. I hope to see some good action coming in next few weeks.</p>
<p>Oh yes, I don&#8217;t want to miss this part. After the release party ended me and <a href="https://fedoraproject.org/wiki/User:Hiemanshu">Hiemanshu</a> planned to end up in pub (purple haze in Kormangla). Ankur and Rangeen didn&#8217;t supported us so we went there alone. Hiemanshu had I believe 2 different cocktails and me 1 pitcher of Foster&#8217;s <img src='http://jeevanullas.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Drink beer use Fedora our motto!! Few pictures were shot by Me, Rangeen, <a href="http://twitter.com/dipjyotighosh">Dipjyoti</a> and Ankur. You can find them here:</p>
<p><a href="http://picasaweb.google.com/dipjyoti.ghosh/Fedora13ReleaseParty#">http://picasaweb.google.com/dipjyoti.ghosh/Fedora13ReleaseParty#</a></p>
<p><a href="http://picasaweb.google.com/sherry151/">http://picasaweb.google.com/sherry151/</a></p>
<p><a href="http://picasaweb.google.com/sanjay.ankur/Fedora13ReleaseParty">http://picasaweb.google.com/sanjay.ankur/Fedora13ReleaseParty</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jeevanullas.in/blog/2010/06/fedora-13-release-party-in-bangalore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hackers dom in Hyderabad</title>
		<link>http://jeevanullas.in/blog/2010/04/hackers-dom-in-hyderabad/</link>
		<comments>http://jeevanullas.in/blog/2010/04/hackers-dom-in-hyderabad/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 03:12:40 +0000</pubDate>
		<dc:creator>jeevanullas</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Eucalyptus]]></category>
		<category><![CDATA[KVM]]></category>

		<guid isPermaLink="false">http://jeevanullas.in/blog/?p=78</guid>
		<description><![CDATA[Well we hackers can&#8217;t live without our machines and that&#8217;s so true. Recently I have been playing with EBS volumes in Eucalyptus but was not able to make it work on Centos 5.4 with XEN more information can be found here. Then I thought to give it a try on our KVM + Fedora 12. [...]]]></description>
			<content:encoded><![CDATA[<p>Well we hackers can&#8217;t live without our machines and that&#8217;s so true. Recently I have been playing with EBS volumes in <a href="http://open.eucalyptus.com">Eucalyptus</a> but was not able to make it work on Centos 5.4 with XEN more information can be found <a href="http://open.eucalyptus.com/forum/euca-attach-volume-failed-centos-54-hotplug-scripts-not-working">here</a>. Then I thought to give it a try on our KVM + Fedora 12. But wait a minute we need more than 1 machine to try EBS volume. Hmm, just gave it a thought and remembered that I have another laptop with me at home. My brother&#8217;s new DELL laptop which is only having Windows 7 and nothing else. He doesn&#8217;t like anyone else to install any other OS on it so I thought of putting Fedora 12 inside VMware and finally after doing that I started my hacking experiment.</p>
<p>I have been running my <a href="http://open.eucalyptus.com">Eucalyptus</a> private cloud on a single laptop till now and knew that I can&#8217;t use brother&#8217;s laptop as node because it has windows 7 and fedora 12 was running inside VM. So I started installing eucalyptus 1.6.2 on that VM via source and finished eucalyptus as well euca2ools installation. Created that VM as the head running Cloud controller, cluster controller, storage controller and walrus. Next I switched to my laptop from scratch installed eucalyptus and configured it to run as node. My laptop is super cool. It&#8217;s been 4 years I have had this machine but the good thing it has the special processor flags which gives VT support so that I can run fully virtualized VM in KVM (kvm_intel).</p>
<p>The next thing which started bothering me was I didn&#8217;t had much space on my laptop left to store the instance copies when it boots up and later runs. But I have a 500 GB hard drive which I can use for this purpose. Created a directory on one of the partitions in my external hard drive and inside my node&#8217;s eucalyptus.conf</p>
<p><code>INSTANCE_PATH="/media/f5a889e3-9300-4565-9cb3-9d14b79ad124/images/"</code></p>
<p>The other thing I changed in my eucalyptus.conf was the VNET_BRIDGE interface which by default is xenbr0. This works good for XEN but not for KVM. Changed it to following:</p>
<p><code>VNET_BRIDGE="virbr0"</code></p>
<p>Then I remember that console thing didn&#8217;t worked for me when I first tried eucalyptus on KVM+Fedora 12 sometime back and for that to work I was suggested a <a href="http://community.eucalyptus.com/forum/new-vm-instances-are-terminated">patch</a> at the forums. Applied that patch on my <em>/opt/eucalyptus/usr/share/eucalyptus/partition2disk</em> and all was set.</p>
<p>The next big thing to work out was my networking. The two laptops could have been connected to each other via a ad-hoc network but I prefer a cable connection as it makes the image transfer faster. I have a cross cable with me so I used it to connect both the laptops. The cross cable connection was available inside my VMware VM via bridged connection. The only thing I did different was the gateway IP inside my head (brother&#8217;s laptop fedora 12 VM running inside VMware) I gave my laptop&#8217;s eth0 IP. This was done because my instance will get a IP on the subnet 192.168.122.0/255.255.255.0 and my network was on 192.168.1.0/255.255.255.0. Once I did that I started the instance and later when it booted was able to ssh to it with my private key (password less login).</p>
<p>The other problem I had was sharing internet connection at the same time. I use a reliance usb device for internet connectivity. I attached that to my laptop started the connection created a simple squid proxy configuration which allows 192.168.1.0/255.255.255.0 and configured the same proxy on the fedora 12 VM in my brother&#8217;s laptop. This made internet as well as yum (had to made a proxy entry in /etc/yum.conf) working on the VM which was required to install some RPMS from the repos.</p>
<p>Sounds cool, eh? Let&#8217;s see a picture of this setup.</p>
<p><a href="http://188.40.110.37/blog/wp-content/uploads/2010/04/17042010085.jpg"><img src="http://jeevanullas.in/blog/wp-content/uploads/2010/04/17042010085-300x225.jpg" alt="" title="Hackers dom in hyderabad" width="300" height="225" class="alignnone size-medium wp-image-79" /></a></p>
<p>In the picture above you can see my laptop on the left hand side connected to my external 500 GB maxtor hard drive, reliance USB device and my brother laptop on the right via cross cable wire.</p>
<p>Though the setup worked and I was able to boot instance and login to them I was not able to see my EBS volume inside the VM. I have updated my forum entry for the same and you can find more information about it <a href="http://community.eucalyptus.com/forum/new-vm-instances-are-terminated">here</a>. Let me know if you have any suggestions for me.</p>
<p>Please note that this is a small private cloud facility running out of my home and its scalable so if you got a laptop or a machine which you would like to add to this cloud do let me know.</p>
<p>Signing off for now but the love for machines still not ends up going to office to play more with those.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeevanullas.in/blog/2010/04/hackers-dom-in-hyderabad/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Cloud Computing is the future</title>
		<link>http://jeevanullas.in/blog/2010/04/cloud-computing-is-the-future/</link>
		<comments>http://jeevanullas.in/blog/2010/04/cloud-computing-is-the-future/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 16:34:00 +0000</pubDate>
		<dc:creator>jeevanullas</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[Eucalyptus]]></category>

		<guid isPermaLink="false">http://jeevanullas.in/blog/?p=75</guid>
		<description><![CDATA[Well for those who don&#8217;t know, since Jan 2010 I have been working on eucalyptus a open source software to setup private cloud inside organization premises. I have seen lot of people blogging about eucalyptus specifically on Ubuntu Server edition. Well to be frank eucalyptus is a great software and it works with almost al [...]]]></description>
			<content:encoded><![CDATA[<p>Well for those who don&#8217;t know, since Jan 2010 I have been working on <a href="http://open.eucalyptus.com/">eucalyptus</a> a open source software to setup private cloud inside organization premises.</p>
<p>I have seen lot of people blogging about eucalyptus specifically on Ubuntu Server edition. Well to be frank eucalyptus is a great software and it works with almost al latest linux distributions. Though I haven&#8217;t found time to test all the available linux distribution as I am stuck with work and Fedora but I have tested it on centos 5.4 and Fedora 12. Works great!</p>
<p>Few problems I have always faced but the IRC channel for eucalyptus on freenode as well as the online <a href="http://open.eucalyptus.com/forum">forums</a> have been really helpful in solving my doubts.</p>
<p>I plan to write my experiences with eucalyptus on this blog in times to come. Besides eucalyptus creating virtual appliances in a automated way is also one of the areas I have worked on paste few weeks. This is all specific to fedora right now using <a href="http://www.jboss.org/stormgrind/projects/boxgrinder/build.html">boxgrinder</a>. It is a alternative to vm-builder which ubuntu folks have got.</p>
<p>I am a strong support of the fedora project and love the way how the fedora community is structured and functions. Have been associated with it since the beginning (Fedora core 1).</p>
<p>In the end, for now, I would just like to say, cloud computing is the future and open source is the best medium we have all got to implement it.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeevanullas.in/blog/2010/04/cloud-computing-is-the-future/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I voted</title>
		<link>http://jeevanullas.in/blog/2008/12/i-voted/</link>
		<comments>http://jeevanullas.in/blog/2008/12/i-voted/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 03:07:00 +0000</pubDate>
		<dc:creator>jeevanullas</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://jeevanullas.in/blog/2008/12/07/i-voted/</guid>
		<description><![CDATA[Cast your vote go to : https://admin.fedoraproject.org/voting]]></description>
			<content:encoded><![CDATA[<p><a href="http://deepsa.fedorapeople.org/fedora-i-voted.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img style="cursor: pointer; width: 250px; height: 250px;" src="http://deepsa.fedorapeople.org/fedora-i-voted.png" border="0" alt="" /></a></p>
<p>Cast your vote go to : <a href="https://admin.fedoraproject.org/voting">https://admin.fedoraproject.org/voting</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jeevanullas.in/blog/2008/12/i-voted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora 10 brings happiness to linuxguru&#039;s Life</title>
		<link>http://jeevanullas.in/blog/2008/11/fedora-10-brings-happiness-to-linuxgurus-life/</link>
		<comments>http://jeevanullas.in/blog/2008/11/fedora-10-brings-happiness-to-linuxgurus-life/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 03:57:00 +0000</pubDate>
		<dc:creator>jeevanullas</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://jeevanullas.in/blog/2008/11/25/fedora-10-brings-happiness-to-linuxgurus-life/</guid>
		<description><![CDATA[Yay!! Cambridge was out yesterday night (IST). And just when the download was about to finish for me I got my Directory Services exams result and I was told that I have passed the exam. w000t. That was the last hurdle in the way to become RHCSS. Finally I can call myself Redhat Certified Security [...]]]></description>
			<content:encoded><![CDATA[<p>Yay!!</p>
<p>Cambridge was out yesterday night (IST).</p>
<p>And just when the download was about to finish for me I got my Directory Services exams result and I was told that I have passed the exam. w000t. That was the last hurdle in the way to become RHCSS.</p>
<p>Finally I can call myself Redhat Certified Security Specialist.</p>
<p>How awesome all this looks. Brand new fedora on my laptop and desktop machines and RHCSS!!!</p>
<p>For verficiation:-</p>
<p>http://www.redhat.com/training/certification/verify/?rhce_cert_display:certno=804006843818597&amp;rhce_cert_display:verify_cb=Verify</p>
]]></content:encoded>
			<wfw:commentRss>http://jeevanullas.in/blog/2008/11/fedora-10-brings-happiness-to-linuxgurus-life/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Introducing myself to Fedora Planet</title>
		<link>http://jeevanullas.in/blog/2008/10/introducing-myself-to-fedora-planet/</link>
		<comments>http://jeevanullas.in/blog/2008/10/introducing-myself-to-fedora-planet/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 02:30:00 +0000</pubDate>
		<dc:creator>jeevanullas</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://jeevanullas.in/blog/2008/10/21/introducing-myself-to-fedora-planet/</guid>
		<description><![CDATA[Hi Fedora Planet, Thanks for accepting me . Those who would like to know more about me just have a look here. Hope to get some meaningful posts in the future. Till then Enjoy!]]></description>
			<content:encoded><![CDATA[<p>Hi Fedora Planet,</p>
<p>Thanks for accepting me <img src='http://jeevanullas.in/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . Those who would like to know more about me just have a look <a href="https://fedoraproject.org/wiki/User:Deepsa">here</a>.</p>
<p>Hope to get some meaningful posts in the future. <img src='http://jeevanullas.in/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Till then Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://jeevanullas.in/blog/2008/10/introducing-myself-to-fedora-planet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securing Log Server in RHEL</title>
		<link>http://jeevanullas.in/blog/2008/07/securing-log-server-in-rhel/</link>
		<comments>http://jeevanullas.in/blog/2008/07/securing-log-server-in-rhel/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 13:15:00 +0000</pubDate>
		<dc:creator>jeevanullas</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://jeevanullas.in/blog/2008/07/28/securing-log-server-in-rhel/</guid>
		<description><![CDATA[Few weeks back I took up the task to replace my syslog server in RHEL5.2 with the new rsyslog package. Redhat packaged rsyslog from RHEL 5 starting with update 2. So I thought of testing it out with stunnel supporting me encryption over the communication line. The setup goes something like this:- I have two [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align: justify;">Few weeks back I took up the task to replace my syslog server in RHEL5.2 with the new rsyslog package. Redhat packaged rsyslog from RHEL 5 starting with update 2. So I thought of testing it out with stunnel supporting me encryption over the communication line.</p>
<p>The setup goes something like this:-</p>
<p>I have two RHEL5.2 machines one is <code>station1</code> and the other is <code>server1</code>. The <code>station1</code> machine sends the log for <code>local6</code> facility of any type of priority to <code>server1</code>. But the log send over to <code>server1</code> is going to be encrypted via stunnel package. Let&#8217;s see how:-</p>
<p><b>Setup at server1</b></p>
<p>This is going to be our central log server for <code>local6</code> log facility. First of all we will install the <code>rsyslog</code> package which though comes with RHEL5.2 but is not the default:-<br /><code><br />#yum install rsyslog<br />#service syslog stop<br />#yum remove sysklogd<br />#service rsyslog start<br />#chkconfig rsyslog on<br /></code></p>
<p>Next we configure rsyslog such that it listens for connections on tcp/61514<br /><code><br />#vi /etc/sysconfig/rsyslog<br /></code></p>
<p>Edit it such that at line 6 it shows:-<br /><code><br />SYSLOGD_OPTIONS="-m 0 -t 61514"<br /></code></p>
<p>Now we need to add this port 61514/tcp to our semanage ports. This will be done via the following command:-<br /><code><br />#semanage port -a -t syslogd_port_t -p tcp 61514<br /></code></p>
<p>Later we can see if the above command have succesfully worked or not by issuing the following command:-<br /><code><br />#semanage port -l | grep syslogd_port_t<br /></code></p>
<p>The output of the above command will be something like this on a default installation of RHEL5.2<br /><code><br />syslogd_port_t                 tcp      61514<br />syslogd_port_t                 udp      514<br /></code></p>
<p>This tells that port 514/udp and port 61514/tcp are SELinux managed for the type syslogd_port_t. Okay that&#8217;s what we wanted. For securing the log server we want it to run on a tcp port and that&#8217;s why we did all this starting from editing <code>/etc/sysconfig/rsyslog</code> to <code>semanage</code>. Note that all our setups have SELinux in enforcing mode so it&#8217;s necessary that we take proper care of SELinux.</p>
<p>Next we restarted the rsyslog service.<br /><code><br />#service rsyslog restart<br /></code></p>
<p>Now we need to configure stunnel on server1 so that it accepts connections from the client on some fix port and forward them to port 61514/tcp running on server1. We will ensure via the iptables that the port 61514/tcp is not directly exposed to the network as well as port 514/udp.<br /><code><br />#iptables -A MYCHAIN -p tcp --dport 60514 -j ACCEPT<br />#service iptables save<br /></code></p>
<p>This rule opens up port 60514/tcp on server1. This will be the port where stunnel running on server1 will listen for client connections and later forward them to locally running rsyslog service at 61514/tcp.</p>
<p>The package for stunnel was installed default in a base installation of RHEL5.2 so that was not a big deal but if it&#8217;s not there in your setup ensure that you have <code>stunnel</code> installed.</p>
<p>After the installation is done we need to configure stunnel. The configuration directory for stunnel is empty but it&#8217;s package provide one sample conf file which can be used. To use the provided conf sample just follow the below commands:-<br /><code><br />#cd /etc/stunnel<br />#cp /usr/share/doc/stunnel-4.15/stunnel.conf-sample stunnel.conf<br /></code></p>
<p>Next we edited the stunnel.conf file according to our requirements and when we completely edited it that&#8217;s how it looked:-</p>
<p><code><br />; Certificate/key is needed in server mode and optional in client mode<br />cert = /etc/stunnel/stunnel.pem<br />key = /etc/stunnel/stunnel.key</p>
<p>; Some security enhancements for UNIX systems - comment them out on Win32<br />chroot = /var/run/stunnel/<br />setuid = nobody<br />setgid = nobody<br />; PID is created inside chroot jail<br />pid = /stunnel.pid</p>
<p>; Some performance tunings<br />socket = l:TCP_NODELAY=1<br />socket = r:TCP_NODELAY=1</p>
<p>; Authentication stuff<br />verify = 2<br />; It's often easier to use CAfile<br />CAfile = /etc/stunnel/cacert.pem</p>
<p>; Service-level configuration<br />[ssyslog]<br />accept = 60514<br />connect = 61514<br /></code></p>
<p>The section <code>[ssyslog]</code> specify which port stunnel will listen to and then which port it will forward the connection too. The destination port is of the local interface (127.0.0.1) as far as I know, haven&#8217;t digged much into it so I am not sure. Please feel free to comment on it.</p>
<p>There are number of other variables on top that configures alot of stuff. First is the filepath for the stunnel security certificate, then is the filepath for the stunnel security certificate key, next comes the directory under which stunnel will run (this makes stunnel run in a chroot jail, that&#8217;s good for security reason but it&#8217;s only available on windows host), after that the user and group with which the application will run and the pid file name and path for stunnel it actually is <code>/stunnel.pid</code> but that&#8217;s relative to <code>/var/run/stunnel</code> now, after that we had some performance tuning options which actually came enabled default in the sample conf file so I thought of keeping them up, after that <code>verify=2</code> is used to verify the other end of the tunnel, the verification is done by checking the security certificate of the other end of the tunnel upto depth level 2 so that checks whether the security certificate of the other end (the client end, in our case station1) is actually signed by the same Certificate Authority (CA) as the one specified by the next option that is <code>CAfile</code>. </p>
<p>Now we need to create the directory in which stunnel will store it&#8217;s pid file and will also run in chrooted jail provided by that directory. The group/owner permission of that directory are also important (as specified in stunnel.conf):-<br /><code><br />#mkdir /var/run/stunnel<br />#chown nobody:nobody /var/run/stunnel<br /></code></p>
<p>Now we need to work on the security certificate stuff. Stunnel uses both self-signed or third party signed certificates. We went with the trusted third party signed certificate. For this we already had a private Certificate Authority running in our network which was used to sign/revoke security certificates of clients in the network.</p>
<p>So first of all we created the key to be used for the certificate and then we generated a certificate signing request for the stunnel certificate and later send that to the certificate authority to sign and return back to us. The certificate authority also sent us a copy of there own certificate which was also kept in <code>/etc/stunnel</code> for configuration purposes. The following command helped in the above task:-<br /><code><br />#cd /etc/stunnel<br />#openssl genrsa -out stunnel.key 2048<br />#openssl req -new -key stunnel.key -out stunnel.csr<br />#scp stunnel.csr root@certificate.example.com:/etc/pki/CA<br /></code></p>
<p>At <code>certificate.example.com</code> we issued the following commands:-<br /><code><br />#cd /etc/pki/CA<br />#openssl ca -in stunnel.csr -out stunnel.pem<br />#scp stunnel.pem cacert.pem root@server1.example.com:/etc/stunnel/<br />#rm -f stunnel.*<br /></code></p>
<p>Note that after we have recieved the signed certificate and CA certificate the first thing we did was secure those by strictly changing there file permissions as shown below:-<br /><code><br />#chown root:root /etc/stunnel/*<br />#chmod 600 /etc/stunnel/*<br /></code></p>
<p>That was sufficient. Well if you are not running a local CA I would suggest you do run it or have a commerical 3rd party trusted authority sign your certificate. For a small setup self sign certificate will do the job so no need for Certificate author<br />
ity. Also note that the step I mentioned above are completely custom as I want them to be it might be that your setup is different then you have to use different commands and options.</p>
<p>That&#8217;s all about stunnel on the server side. Now was the time to start the tunnel, so that&#8217;s done just by running the command <code>stunnel</code>.<br /><code><br />#stunnel<br />#ps aux | grep stunnel<br /></code></p>
<p>The first command runs the tunnel and the next command is given to make sure if stunnel is running in the background successfully or not. The output should be something like this<br /><code><br />nobody    4476  0.0  0.3   5060   984 ?        Ss   16:46   0:00 stunnel<br /></code></p>
<p>If you want to make sure that stunnel runs automatically on every boot up just put these lines in <code>/etc/rc.d/rc.local</code> of your system (at the bottom):-<br /><code><br />/usr/sbin/stunnel<br /></code></p>
<p>That&#8217;s it the job at <code>server1</code> is done and now it&#8217;s time to proceed at the client side.</p>
<p><b>Setup at station1</b></p>
<p>First the same steps as performed on <code>server1</code> installing rsyslog package and removing the stock <code>sysklogd</code> package via the following commands:-<br /><code><br />#yum install rsyslog<br />#service syslog stop<br />#yum remove sysklogd<br />#service rsyslog start<br />#chkconfig rsyslog on<br /></code></p>
<p>Now we need to configure the stunnel package on the client side too. As mentioned earlier stunnel comes with the default installation of RHEL5.2 but if it&#8217;s not installed just make sure you have it installed. Stunnel actually is part of official RHEL5.2 distribution. Next as done earlier copy the sample configuration file provided by the stunnel package to the stunnel configuration directory.<br /><code><br />#cd /etc/stunnel<br />#cp /usr/share/doc/stunnel-4.15/stunnel.conf-sample stunnel.conf<br /></code></p>
<p>Edit the file such that it looks as shown below:-<br /><code><br />; Certificate/key is needed in server mode and optional in client mode<br />cert = /etc/stunnel/stunnel.pem<br />key = /etc/stunnel/stunnel.key</p>
<p>; Protocol version (all, SSLv2, SSLv3, TLSv1)<br />sslVersion = SSLv3</p>
<p>; Some security enhancements for UNIX systems - comment them out on Win32<br />chroot = /var/run/stunnel/<br />setuid = nobody<br />setgid = nobody<br />; PID is created inside chroot jail<br />pid = /stunnel.pid</p>
<p>; Some performance tunings<br />socket = l:TCP_NODELAY=1<br />socket = r:TCP_NODELAY=1</p>
<p>; Authentication stuff<br />verify = 2<br />; It's often easier to use CAfile<br />CAfile = /etc/stunnel/cacert.pem</p>
<p>; Use it for client mode<br />client = yes</p>
<p>; Service-level configuration<br />[ssyslog]<br />accept = 127.0.0.1:61514<br />connect = 192.168.122.2:60514<br /></code></p>
<p>The major difference between the stunnel.conf of station1 and server1 is that the stunnel.conf of station1 contains a variable <code>client = yes</code> that differentiates server end and client end in a stunnel.</p>
<p>First we will create the chroot directory in which stunnel will run. As done in the configuring the server section above:-<br /><code><br />#mkdir /var/run/stunnel<br />#chown nobody:nobody /var/run/stunnel<br /></code></p>
<p>Now it&#8217;s time to make the security certificate for this end of the tunnel. We will proceed in the same way as we did while setting up the server end. First we will generate a 2048 bit key. One particular thing which I forgot to mention about this key is that it&#8217;s not a password protected key. If it&#8217;s compromised that end of the tunnel is compromised. We could have protected the key with a password by specifying option like -des3 to the genrsa command but then we would have to give the password for the key when we ran stunnel that asks alot of overhead when we say our tunnel will automatically start on boot. In that case we have to manually feed in the password for the tunnel to get started. <br /><code><br />#cd /etc/stunnel<br />#openssl genrsa -out stunnel.key 2048<br />#openssl req -in -key stunnel.key -out stunnel.csr<br />#scp stunnel.csr root@certificate.example.com:/etc/pki/CA<br /></code></p>
<p>At <code>certificate.example.com</code> the following commands were issued:-<br /><code><br />#cd /etc/pki/CA<br />#openssl ca -in stunnel.csr -out stunnel.pem<br />#scp stunnel.pem cacert.pem root@station1.example.com:/etc/stunnel<br />#rm -f stunnel.*<br /></code></p>
<p>Now as we did during setting up the server end we secure the configuration file and the certificate files at the client end by modifying the file permissions accordingly:-<br /><code><br />#chown root:root /etc/stunnel/*<br />#chmod 600 /etc/stunnel/*<br /></code></p>
<p>Now we can start the stunnel at the client end too via the simple command <code>stunnel</code>. If we want to start the tunnel automatically on every boot up it&#8217;s simple just add the line <code>/usr/sbin/stunnel</code> in <code>/etc/rc.d/rc.local</code> at the end. To verify that stunnel is running properly or not just issue the old command <code>ps aux | grep stunnel</code> and see if there is any process owned by user <code>nobody</code> with the name stunnel.</p>
<p>Now we will configure the rsyslog service at the client so that it re-directs all the logs for <code>local6</code> facility to <code>127.0.0.1:61514</code> where stunnel will read them up and send them to <code>192.168.122.2:60514</code>. Note here that <code>192.168.122.2</code> is actually <code>server1</code> but instead of specifying the name I preferred IP address as DNS can be un-available in my setup.</p>
<p>The below line I added in <code>/etc/rsyslog.conf</code>:-<br /><code><br />local6.*                                                        @@127.0.0.1:61514<br /></code></p>
<p>Save and exit and then restart rsyslog:-<br /><code><br />#service rsyslog restart<br /></code></p>
<p>Now to test the setup we issued the following command at station1 and while that was running we sniff the packet via wireshark available in RHEL5.2 to intercept what was getting transferred between the two tunnel ends:-<br /><code><br />logger -i -p local6.info -t deependra "This is a test log message sent over stunnel"<br /></code></p>
<p>The output was clearly seen at server1 in <code>/var/log/messages</code> as<br /><code><br />Jul 28 18:24:30 station1 deependra[3460]: This is a test log message sent over stunnel<br /></code></p>
<p>While the communication was happening between the two ends of the tunnel I sniffed the packets transferred between the two ends and it was all encrypted from what I saw.</p>
<p>That&#8217;s how I was able to secure my log server communication with clients. There are much better and inbuilt ways to provide security of log server which comes with rsyslog that you can check out at rsyslog <a href="http://www.rsyslog.com/">website</a>.</div>
]]></content:encoded>
			<wfw:commentRss>http://jeevanullas.in/blog/2008/07/securing-log-server-in-rhel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NTP Server</title>
		<link>http://jeevanullas.in/blog/2008/07/ntp-server/</link>
		<comments>http://jeevanullas.in/blog/2008/07/ntp-server/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 06:47:00 +0000</pubDate>
		<dc:creator>jeevanullas</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://jeevanullas.in/blog/2008/07/27/ntp-server/</guid>
		<description><![CDATA[It&#8217;s been long since I am using NTP server in my installations here. So I thought to document my setup a bit in order to explain myself what&#8217;s going on and to help others world wide so that they can also have a secure setup for Time server in Linux. Time server is a important [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align: justify;">It&#8217;s been long since I am using NTP server in my installations here. So I thought to document my setup a bit in order to explain myself what&#8217;s going on and to help others world wide so that they can also have a secure setup for Time server in Linux.</p>
<p>Time server is a important part of a network as everybody might be knowing. It is a must if we want to have a network setup which will later consists of kerberos or DNSSEC. It is also needed in windows environment but the configuration for that need not be done in the default case.</p>
<p>I have my test server running latest updated version of Fedora 9. First of all I make sure that my setup have the ntp package. Actually ntp comes default with Fedora distribution so I had no problem in getting the package.</p>
<p>Next step was to make sure I have the correct configuration file setup. So I took a backup of the original file that is <code>/etc/ntp.conf</code> first.<br /><code><br />mv /etc/ntp.conf /etc/ntp.conf.bak<br /></code><br />Next I wrote the following in a new <code>/etc/ntp.conf</code><br /><code><br />server 127.127.1.0<br />fudge 127.127.1.0 stratum 1<br />crypto pw redhat randfile /dev/urandom<br />keysdir /etc/ntp<br />restrict default ignore<br />restrict 127.0.0.1<br />restrict 192.168.122.0 mask 255.255.255.0 nomodify noquery<br />driftfile /var/lib/ntp/drift<br /></code></p>
<p>I know the above options are not the best of the breed but I will explain. First of all if we used our local hardware clock as the time source and then declared it to be at stratum 1 via the fudge line. That may sound madness to everybody. <b>This was done just for testing purpose. Don&#8217;t do this in your production servers. Please use reliable time source which can be found at <a href="http://support.ntp.org/bin/view/Servers/StratumTwoTimeServers">http://support.ntp.org/bin/view/Servers/StratumTwoTimeServers</a></b></p>
<p>The next line is the <code>crypto</code> line which tells that my ntpkey files are protected with a password <code>redhat</code> and that the filesource which is used for generating random seed data is <code>/dev/urandom</code>. Note that the password attribute is a important one so this file which <code>/etc/ntp.conf</code> should have a strict permission.</p>
<p><code><br />#chmod 640 /etc/ntp.conf<br />#chown root.ntp /etc/ntp.conf<br /></code></p>
<p>Now the next line tells the directory where all the ntpkey_* files are stored. In fedora 9 it defaults to <code>/etc/ntp/crypto</code> but I used <code>/etc/ntp</code> which is default in RHEL 5.</p>
<p>Next three lines controls the access to the NTP server. The first of them restricts everybody to use the time server or remotely configure the time server. Next restrict line opens up restrictions for the local interface that is 127.0.0.1 This address can do anything no restrictions apply on it. The last restrict line opens the network 192.168.122.0/24 to use the time server to get time service but it can&#8217;t modify or query (status query on time server) the time server itself. That means any client in the 192.168.122.0/24 can configure 192.168.122.1 as it&#8217;s reliable time source but it can&#8217;t use to connect to that server via ntpq or ntpdc utility.</p>
<p>The last line specify the file name which contains the latest estimate of clock frequency error. This file is owned by ntp user.</p>
<p>In the next step we switch to directory <code>/etc/ntp</code> and generate the host keys and IFF parameters as we are going to use IFF identity scheme in this setup.</p>
<p><code><br />#cd /etc/ntp<br />#ntp-keygen -T -I -p redhat<br /></code></p>
<p>The above command generates the key files and IFF parameters file. The host key file is protected with a password <code>redhat</code> that we also mentioned in <code>/etc/ntp.conf</code>. The list of files which were generated in my case are listed below</p>
<p><code><br />ntpkey_cert_station1.example.com<br />ntpkey_IFFpar_station1.example.com.3426211635<br />ntpkey_RSA-MD5cert_station1.example.com.3426211635<br />ntpkey_host_station1.example.com<br />ntpkey_iff_station1.example.com<br />ntpkey_IFFkey_station1.example.com.3426211635<br />ntpkey_RSAkey_station1.example.com.3426211635<br /></code></p>
<p>In the above list some are key files and some are symbolic links to them. Next we need to extract the IFFkey so that it can transferred to every NTP clients of this server. We can also protect this key with a password that only we and the NTP client knows.</p>
<p><code><br />#ntp-keygen -e -q redhat -p linux > ntpkey_IFFkey_station1.example.com.3426211635<br />#scp ntpkey_IFFkey_station1.example.com.3426211635 root@server1.example.com:/etc/ntp<br /></code></p>
<p>The above command generate the IFFkey file but the IFF parameter file itself is protected by a password which we specified in the first ntp-keygen command so with -q we specified that password and with -p we specified the password with which the IFFkey file will be protected (the client needs to know this password). The -e option is used to export the IFFkey.</p>
<p>Now I started the ntpd service and configured it to start automatically at the next boot up. Also I had a custom chain in my iptable based firewall in which I opened the udp/123 port on which ntpd listens.<br /><code><br />#service ntpd start<br />#chkconfig ntpd on<br />#iptables -A MYCHAIN -p udp --dport 123 -j ACCEPT<br />#service iptables save<br /></code><br />Next was the setup at client side that was pretty easy. First of all I configured as usual the main configuration file <code>/etc/ntp.conf</code><br /><code><br />#chmod 640 /etc/ntp.conf<br />#chown root.ntp /etc/ntp.conf<br />#vi /etc/ntp.conf<br /></code></p>
<p>The client side ntp.conf contained the following:<br /><code><br />server station1.example.com iburst autokey<br />crypto pw linux randfile /dev/urandom<br />keysdir /etc/ntp<br /></code></p>
<p>The above lines specify the preferred time server to use be <code>station1.example.com</code> aka <code>192.168.122.1</code>. The option autokey enables the use of public key cryptography. The next line specify the crypto password with which the client ntpkey_* files will be protected and also specify the random seed source to be used. Next line specify where to find the key data.</p>
<p>Next we generated the client side parameters by the following commands<br /><code><br />#cd /etc/ntp/<br />#ntp-keygen -H -p linux<br />#ln -s ntpkey_IFFkey_station1.example.com.3426211635 ntpkey_iff_station1.example.com<br />#ln -s ntpkey_host_server1.example.com ntpkey_iff_server1.example.com<br /></code></p>
<p>The above generates the host parameters on the client side protected by the password <code>linux</code> and next create some symlinks which later configure the IFF keys at the client side. Note here that the file <code>ntpkey_IFFkey_station1.example.com.3426211635</code> was sent by the time server which was protected by the password <code>linux</code>.</p>
<p>The list of file with the prefix ntpkey_ in there name at the client side <code>/etc/ntp</code> were finally:-</p>
<p><code><br />ntpkey_cert_server1.example.com<br />ntpkey_host_server1.example.com<br />ntpkey_IFFkey_station1.example.com.3426211635<br />ntpkey_iff_server1.example.com<br />ntpkey_iff_station1.example.com<br />ntpkey_RSAkey_server1.example.com.3426211933<br />ntpkey_RSA-MD5cert_server1.example.com.3426211933<br /></code></p>
<p>Now we started the time service at the client and configured it to start automatically at boot and also open the udp/123 port.</p>
<p><code><br />#ntpdate -b station1.example.com<br />#service ntpd start<br />#chkconfig ntpd on<br />#iptables -A MYCHAIN -p udp --dport 123 -j ACCEPT<br />#service iptables save<br /></code></p>
<p>The first command in the above code was issued to first synchronize the clock of the client with that of the server then start the time service to later keep that new time in synchronization with the server. It took approx. 5 minutes to get synchronized and after that when issued the fo<br />
llowing command the output was:</p>
<p><code><br />#ntpq -cas</p>
<p>ind assID status  conf reach auth condition  last_event cnt<br />===========================================================<br />  1 28241  f624   yes   yes   ok   sys.peer   reachable  2</p>
<p>#ntpq -c"rv 0 cert"<br />assID=0 status=0664 leap_none, sync_ntp, 6 events, event_peer/strat_chg,<br />cert="server1.example.com station1.example.com 0x6",<br />expire=200907280654,<br />cert="station1.example.com station1.example.com 0x7",<br />expire=200907280527, cert="server1.example.com server1.example.com 0x2",<br />expire=200907280532</p>
<p>#ntpq -c"rv 28241 flags"<br />assID=28241 status=f624 reach, conf, auth, sel_sys.peer, 2 events, event_reach,<br />flags=0x83f21<br /></code></p>
<p>The last command issued returned the flags as <code>0x83f21</code> that signifies that the communication with the time server was successful and that IFF identity scheme with cryptography enabled was used.</p>
<p>Client side utilities to check the time configuration are <code>ntpq,ntptrace,ntpdate,nptdc,ntpstat</code> etc.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://jeevanullas.in/blog/2008/07/ntp-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
