<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5767132627703609738</id><updated>2024-09-06T12:01:42.093-07:00</updated><title type='text'>Linux System Internals</title><subtitle type='html'>System Admin recipes for common issues you run into day to day.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://linuxsysint.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://linuxsysint.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>G. Ryan Fawcett</name><uri>http://www.blogger.com/profile/07681472878702166327</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEzIDTqwXU1ThG2xrsSjilH2duHyz3LpLiC7Q-1YqX_nmmdDOEgebavfT31pVKCw4mSLq7NMSM5Xx9R4l8yrWDU1x-u8r4FTVUr12o881Rriv4r_V8WAAQ7Q1j6mq_noe9Q3nfHQrhOoAoZbAW36mODy7-ywV6qTCIWkY1Xx8o30tV9A/s220/Profile.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5767132627703609738.post-7450884308830236010</id><published>2012-08-20T14:35:00.001-07:00</published><updated>2012-08-20T14:37:11.936-07:00</updated><title type='text'>Capturing %Post Kickstart Install output</title><content type='html'>I found this very very useful in troubling my provisioning systems to find out what happend in the post install script output of kickstart. &amp;nbsp;The tee command is very useful for this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
%post --interpreter /bin/bash&lt;br /&gt;
(&lt;br /&gt;
scripting goes here&lt;br /&gt;
&lt;br /&gt;
) | &amp;nbsp;2&amp;gt;&amp;amp;1 | tee /root/post-log.log&lt;br /&gt;
&lt;br /&gt;
In your kickstart file add something like this.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
%post --interpreter /bin/sh&lt;br /&gt;
(&lt;br /&gt;
# mount disk from the NFS server which contains support files&lt;br /&gt;
mkdir -p /mnt/tmp&lt;br /&gt;
mount nfs:volume /mnt/tmp&lt;br /&gt;
# run the top-level post-install script&lt;br /&gt;
cd /mnt/tmp&lt;br /&gt;
. ./postinstall.sh&lt;br /&gt;
cd /&lt;br /&gt;
# unmount the disk and delete the mount point&lt;br /&gt;
umount /mnt/tmp&lt;br /&gt;
rmdir /mnt/tmp ) &amp;nbsp;2&amp;gt;&amp;amp;1 | tee /root/post-log.log&lt;br /&gt;
# post-installation script ends&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/7450884308830236010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/7450884308830236010'/><link rel='alternate' type='text/html' href='http://linuxsysint.blogspot.com/2012/08/capturing-post-kickstart-install-output.html' title='Capturing %Post Kickstart Install output'/><author><name>G. Ryan Fawcett</name><uri>http://www.blogger.com/profile/07681472878702166327</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEzIDTqwXU1ThG2xrsSjilH2duHyz3LpLiC7Q-1YqX_nmmdDOEgebavfT31pVKCw4mSLq7NMSM5Xx9R4l8yrWDU1x-u8r4FTVUr12o881Rriv4r_V8WAAQ7Q1j6mq_noe9Q3nfHQrhOoAoZbAW36mODy7-ywV6qTCIWkY1Xx8o30tV9A/s220/Profile.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5767132627703609738.post-5829493454616180096</id><published>2012-08-03T06:44:00.001-07:00</published><updated>2012-08-20T14:36:53.412-07:00</updated><title type='text'>Converting Pupppet User.pp to Chef User.json</title><content type='html'>For the last couple weeks my team and I have been looking at Chef.&lt;br /&gt;
We currently have medium size puppet deployment but wants to see if the grass is greener on the other side with chef. Chef seems to be allot more scripting where puppet is more of template based DSL.&lt;br /&gt;
&lt;br /&gt;
Regardless One of the first hurdles we faced was migrating users from one to another&lt;br /&gt;
Here is a little perl to help anybody get past this hurdle.&lt;br /&gt;
&lt;br /&gt;
*** Update *****&lt;br /&gt;
&lt;br /&gt;
Ran into a little issue converting this with the GID so I took it out the useradd adds this for you so no need to do it.&lt;br /&gt;
&lt;br /&gt;
./convert-to-chef.pl user.pp&lt;br /&gt;
&lt;br /&gt;
It outputs it as user.json&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
###### Convert-to-chef.pl ################&lt;br /&gt;
#!/usr/bin/perl&lt;br /&gt;
use Switch;&lt;br /&gt;
$userfile = $ARGV[0];&lt;br /&gt;
open(USERFILE, &quot;$userfile&quot;) or die $! ;&lt;br /&gt;
@lines = &lt;userfile&gt; ;&lt;br /&gt;foreach (@lines)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;$line = $_ ;&lt;br /&gt;&amp;nbsp; switch ( $line )&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case (/account/) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @account_line = split(/\{/,$line);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $account = $account_line[1];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $account =~ s/\,//g ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $account =~ s/\://g ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $account =~ s/\&quot;//g ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $account =~ s/\”//g ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $account =~ s/\ //g ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chomp($account);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case (/uid/) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @uid_line = split(/\&amp;gt;/, $line);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $uid = $uid_line[1];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $uid =~ s/\,//g ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $uid =~ s/\ //g ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chomp($uid);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case (/gid/) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @gid_line = split(/\&amp;gt;/, $line);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $gid = $gid_line[1] ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $gid =~ s/\,//g ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $gid =~ s/\ //g ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chomp($gid);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case (/comment/) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @comment_array = split(/\&amp;gt;/, $line);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $comment = $comment_array[1];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $comment =~ s/\,//g ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chomp($comment);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;close(USERFILE);&lt;br /&gt;&lt;br /&gt;open(CHEFFILE, &quot;&amp;gt;$account.json&quot;) or die $! ;&lt;br /&gt;&lt;br /&gt;print CHEFFILE &quot;&lt;br /&gt;\{&lt;br /&gt;&amp;nbsp; \&quot;id\&quot;\: \&quot;$account\&quot;\,&lt;br /&gt;&amp;nbsp; \&quot;uid\&quot;\: \&quot;$uid\&quot;\,&lt;br /&gt;&amp;nbsp; \&quot;home_dir\&quot;\: \&quot;\/home\/$account\&quot;\,&lt;br /&gt;&amp;nbsp; \&quot;group\&quot;\: \&quot;wheel\&quot;\,&lt;br /&gt;&amp;nbsp; \&quot;shell\&quot;\: \&quot;\/bin\/bash\&quot;\&lt;br /&gt;\}&lt;br /&gt;&quot;;&lt;br /&gt;close(CHEFFILE);&lt;/userfile&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/5829493454616180096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/5829493454616180096'/><link rel='alternate' type='text/html' href='http://linuxsysint.blogspot.com/2012/08/converting-pupppet-userpp-to-chef.html' title='Converting Pupppet User.pp to Chef User.json'/><author><name>G. Ryan Fawcett</name><uri>http://www.blogger.com/profile/07681472878702166327</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEzIDTqwXU1ThG2xrsSjilH2duHyz3LpLiC7Q-1YqX_nmmdDOEgebavfT31pVKCw4mSLq7NMSM5Xx9R4l8yrWDU1x-u8r4FTVUr12o881Rriv4r_V8WAAQ7Q1j6mq_noe9Q3nfHQrhOoAoZbAW36mODy7-ywV6qTCIWkY1Xx8o30tV9A/s220/Profile.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5767132627703609738.post-9196510724122408310</id><published>2009-01-31T10:32:00.000-08:00</published><updated>2009-09-17T18:17:38.838-07:00</updated><title type='text'>OpenVPN and Mac Os Tunnelblick</title><content type='html'>I wanted a quick and easy way to VPN into my house from anywhere. Enter OpenVPN an Open source VPN solution was perfect for what I needed.  What I wanted to do is setup a VPN client on my laptop so I could get into my home network.  I found Tunnelblick client for Mac OS X. There is an OpenVPN client for windows as well.&lt;br /&gt;See http://openvpn.se/ for details.&lt;br /&gt;&lt;br /&gt;There is two modes to run OpenVPN in Tap or Tun this is import to understanding how openvpn works.&lt;br /&gt;&lt;br /&gt;Here is a excerpt from the OpenVPN FAQ&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&quot;The difference between a tun and tap device is this: a tun device is a virtual IP point-to-point device and a tap device is a virtual Ethernet device. So getting back to the &quot;long cable&quot; analogy, using a tun device would be like having a T1 cable connecting the computers and using a tap device would be like having an Ethernet network connecting the two computers. People who are running applications that need the special features of Ethernet (which won&#39;t work on an IP-only network) will often bridge their physical local Ethernet with a tap device (using a utility such as brctl on Linux), then VPN the tap device to another similar setup at the other end. This allows OpenVPN to route Ethernet broadcasts and non-IP protocols such as Windows NetBIOS over the VPN. If you don&#39;t need the special features of Ethernet (such as bridging capability), it&#39;s better to use a tun device.&lt;/span&gt;&quot;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Setting up The Server&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Setting up the CA for easy-rsa that comes with OpenVPN.&lt;br /&gt;The easy-rsa directory can usually be found in /usr/share/doc/packages/openvpn or /usr/share/doc/openvpn-2.0&lt;br /&gt;&lt;br /&gt;Make sure all the scripts that are running are chmod 755 so they get executed properly. Running the vars script sets up the directory to store the keys and such but you might have to create the directory.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;. ./vars&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;./clean-all&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;./build-ca&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Walk through the steps on setting up the CA.&lt;br /&gt;For example common name should be a domain named mycompany.org.&lt;br /&gt;Make sure you don’t do host.mycompany.org just mycompany.org for the common name setting up the CA.&lt;br /&gt;&lt;br /&gt;Ok now the server CA key is setup lets work on the Server keys&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;./build-key-server server.mycompany.org&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ok now lets build the client key.&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;./build-key client1.mycompany.org&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Move the CA.crt and  Server.crt and key to your ~/Library/OpenVPN directory on the Mac.&lt;br /&gt;&lt;br /&gt;Now lets look at the server configuration&lt;br /&gt;Here is my server config and I will break it down so it makes sense.&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#daemon means it running in daemon mode &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;daemon&lt;br /&gt;port 4444&lt;br /&gt;proto udp&lt;br /&gt;# Dev Tun interface&lt;br /&gt;dev tun&lt;br /&gt;#Server External IP Address&lt;br /&gt;local 67.180.145.190 1194&lt;br /&gt;#Tls protocol&lt;br /&gt;tls-server&lt;br /&gt;# CA Cert&lt;br /&gt;ca ca.crt&lt;br /&gt;cert mycert.company.com.crt&lt;br /&gt;key  mycert.company.com.key&lt;br /&gt;dh dh1024.pem&lt;br /&gt;#Server internal IP Adress&lt;br /&gt;server 192.168.3.0 255.255.255.0&lt;br /&gt;ifconfig-pool-persist /etc/openvpn/ipp.txt&lt;br /&gt;#pushes the route route to the client&lt;br /&gt;push &quot;route 192.168.10.0 255.255.255.0&quot;&lt;br /&gt;&lt;br /&gt;keepalive 10 120&lt;br /&gt;persist-key&lt;br /&gt;persist-tun&lt;br /&gt;comp-lzo&lt;br /&gt;status /var/log/openvpn-status.log&lt;br /&gt;verb 3&lt;br /&gt;mute 20&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Setting up the client&lt;/span&gt;&lt;br /&gt;OK at this time download the &lt;a href=&quot;http://code.google.com/p/tunnelblick/&quot;&gt;tunnelblick&lt;/a&gt; client dmg and install it.&lt;br /&gt;The Client configuration goes in ~/Library/openvpn/&lt;br /&gt;&lt;br /&gt;Become root on your machine&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;sudo bash&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;cd ~/Library/openvpn &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Mv openvpn.conf to openvpn.org&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create the configuration with the following entries.&lt;br /&gt;&lt;br /&gt;Client Config&lt;br /&gt;# Remove Server&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;remote 67.180.145.190&lt;br /&gt;port 4444&lt;br /&gt;dev tun&lt;br /&gt;client&lt;br /&gt;dev tun&lt;br /&gt;proto udp&lt;br /&gt;resolv-retry infinite&lt;br /&gt;nobind&lt;br /&gt;user nobody&lt;br /&gt;group nobody&lt;br /&gt;persist-key&lt;br /&gt;persist-tun&lt;br /&gt;comp-lzo&lt;br /&gt;verb 3&lt;br /&gt;log openvpn.log&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;That’s it as always if you have any questions contact me a gryanfawcett At gmail dot com.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/9196510724122408310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/9196510724122408310'/><link rel='alternate' type='text/html' href='http://linuxsysint.blogspot.com/2009/01/openvpn-and-mac-os-tunnelblick.html' title='OpenVPN and Mac Os Tunnelblick'/><author><name>G. Ryan Fawcett</name><uri>http://www.blogger.com/profile/07681472878702166327</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEzIDTqwXU1ThG2xrsSjilH2duHyz3LpLiC7Q-1YqX_nmmdDOEgebavfT31pVKCw4mSLq7NMSM5Xx9R4l8yrWDU1x-u8r4FTVUr12o881Rriv4r_V8WAAQ7Q1j6mq_noe9Q3nfHQrhOoAoZbAW36mODy7-ywV6qTCIWkY1Xx8o30tV9A/s220/Profile.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5767132627703609738.post-8008961921539827332</id><published>2009-01-18T12:47:00.000-08:00</published><updated>2009-01-18T13:34:26.237-08:00</updated><title type='text'>Kickstart Package Selection and Base Kickstart</title><content type='html'>So a while back I was looking at the Kickstart docs on the Package selection. I searched the net for a list of Packages to install other then @ base &amp;amp; @ core. Well buried in the docs, the following paragraph told me where to look.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&quot;Packages can be specified by group or by individual package name, including with globs using the asterisk. The installation program defines several groups that contain related packages. Refer to the &lt;/span&gt;&lt;code style=&quot;font-style: italic;&quot; class=&quot;filename&quot;&gt;&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;variant&lt;/code&gt;&lt;/em&gt;/repodata/comps-*.xml&lt;/code&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; file on the first Red Hat Enterprise Linux CD-ROM for a list of groups.&quot;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;I took the liberty of going though the file, pulling out all the package info for you, excluding the language packages.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;br /&gt;admin-tools&lt;br /&gt;authoring-and-publishing&lt;br /&gt;base&lt;br /&gt;base-x&lt;br /&gt;core&lt;br /&gt;development-libs&lt;br /&gt;development-tools&lt;br /&gt;dialup&lt;br /&gt;dns-server&lt;br /&gt;editors&lt;br /&gt;engineering-and-scientific&lt;br /&gt;ftp-server&lt;br /&gt;games&lt;br /&gt;gnome-desktop&lt;br /&gt;gnome-software-development&lt;br /&gt;graphical-internet&lt;br /&gt;graphics&lt;br /&gt;java&lt;br /&gt;java-development&lt;br /&gt;kde-desktop&lt;br /&gt;kde-software-development&lt;br /&gt;legacy-network-server&lt;br /&gt;legacy-software-development&lt;br /&gt;legacy-software-support&lt;br /&gt;mail-server&lt;br /&gt;mysql&lt;br /&gt;network-server&lt;br /&gt;news-server&lt;br /&gt;office&lt;br /&gt;openfabrics-enterprise-distribution&lt;br /&gt;printing&lt;br /&gt;ruby&lt;br /&gt;server-cfg&lt;br /&gt;smb-server&lt;br /&gt;sound-and-video&lt;br /&gt;sql-server&lt;br /&gt;system-tools&lt;br /&gt;text-internet&lt;br /&gt;web-server&lt;br /&gt;x-software-development&lt;br /&gt;language-support&lt;br /&gt;desktops&lt;br /&gt;apps&lt;br /&gt;development&lt;br /&gt;servers&lt;br /&gt;base-system&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;I also wanted to post my base.ks file for those who want to use it as a template for starting off with a basic  Kickstart. The base OS install image size is about 1.9 gigs. This includes all the system admin tools, development stuff for gcc/make, development libs, emacs and pico.   Remember to use grub-md5-crypt to create a hash for the root password.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;# System bootloader configuration&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;bootloader --location=mbr&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;# Clear the Master Boot Record&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;zerombr&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#Do Text install&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;text&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;# Firewall configuration&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;firewall --disabled&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;# Run the Setup Agent on first boot&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;firstboot --disable&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;# System keyboard&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;keyboard us&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;# System language&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;lang en_US&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#Install method&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;url --url http://192.168.1.11/install/&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#network configuration&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;network --bootproto=dhcp&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;# Installation logging level&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;logging --level=info&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#Clear all linux partiions&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;clearpart --all&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#Create Linux Paritions&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;part swap --size=1024&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;part / --size 5000 --fstype ext3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#Tying in Custom Repo&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;repo --name=myrepo --baseurl=http://192.168.1.11/server/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#Root password&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;# &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot; id=&quot;intelliTxt&quot;&gt;use grub-md5-crypt&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; to generate a md5 crypt hash&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;# default password is redhat&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;rootpw --iscrypted $1$GRwvp$HcYuBdNae5mlPyXwVUc1E0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#RHN Key&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;key --skip&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;# SELinux configuration&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;selinux --disable&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;# System timezone&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;timezone  America/Los_Angeles&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;# Install OS instead of upgrade&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;install&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;%packages&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;@admin-tools&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;@base&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;@core&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;@development-tools&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;@development-libs&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;@editors&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;@text-internet&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;@system-tools&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/8008961921539827332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/8008961921539827332'/><link rel='alternate' type='text/html' href='http://linuxsysint.blogspot.com/2009/01/kickstart-package-selection-and-base.html' title='Kickstart Package Selection and Base Kickstart'/><author><name>G. Ryan Fawcett</name><uri>http://www.blogger.com/profile/07681472878702166327</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEzIDTqwXU1ThG2xrsSjilH2duHyz3LpLiC7Q-1YqX_nmmdDOEgebavfT31pVKCw4mSLq7NMSM5Xx9R4l8yrWDU1x-u8r4FTVUr12o881Rriv4r_V8WAAQ7Q1j6mq_noe9Q3nfHQrhOoAoZbAW36mODy7-ywV6qTCIWkY1Xx8o30tV9A/s220/Profile.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5767132627703609738.post-7036693291108921455</id><published>2009-01-08T20:49:00.000-08:00</published><updated>2009-01-09T13:22:02.218-08:00</updated><title type='text'>Custom Yum Repos</title><content type='html'>If you have gotten your development team to do releases in rpm format you already won half the battle.  So here is a quick Howto on setting up custom Yum repos. So in this example I took the RHEL 5.2 CDROM and created my own repo for all the packages on the CD. It takes care of all the basic stuff for using yum and gets ride of the nasty rpm dependencies.&lt;br /&gt;&lt;br /&gt;Note that this works for custom repos anywhere you want to put rpm packages that can be part of the OS or custom RPMS for company releases repo.&lt;br /&gt;&lt;br /&gt;First things make sure apache is installed or install it from the media.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;rpm -ivh /mnt/cdrom/server/httpd-2.2.3-11.el5_1.3.i386.rpm&lt;/span&gt;&lt;br /&gt;rpm -hiv /mnt/cdrom/server/yum*&lt;br /&gt;&lt;br /&gt;Then you will need to pull this package from dags website.&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;br /&gt;rpm -ivh http://dag.wieers.com/rpm/packages/createrepo/createrepo-0.4.8-1.el5.rf.no&lt;/span&gt;arch.rpm&lt;br /&gt;&lt;br /&gt;Now copy the server directory of all the rpms to&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;cp /mnt/cdrom/server/*.* /var/www/html/server/&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;chown -R apache:apache /var/www/html/server/&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;chmod -R 755 /var/www/html/server/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Nows lets build the repo xml files&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;cd /var/www/html/server&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;createrepo .&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now comes the interesting part - now we need to add the yum repo to yum&#39;s repositories.&lt;br /&gt;&lt;br /&gt;You can use this file as a template and distribute to all your servers.  A good idea is to use my rpm building script to make a custom rpm package. Tar up  all your repos from a tar up /etc/yum.repos.d. Create the rpm  and add it to your kickstart install.&lt;br /&gt;&lt;br /&gt;Script is &lt;a href=&quot;http://linuxsysint.blogspot.com/2008/12/rpm-foo-creating-rpms-from-tar-files.html&quot;&gt;here&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href=&quot;http://linuxsysint.blogspot.com/2008/12/rpm-foo-creating-rpms-from-tar-files.html&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;[My Repo]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;name=Red Hat Enterprise Linux $releasever - $basearch - Debug&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;baseurl=http://yoursever.yourdoamin.org/server&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;enabled=1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;gpgcheck=0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Save it to /etc/yum.repos.d/my.repo&lt;br /&gt;&lt;br /&gt;Now lets restart yum update demon.&lt;br /&gt;service restart yum-updatesd&lt;br /&gt;&lt;br /&gt;Now lets run the yum command to test it.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;yum list ruby*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There a fully functional yum repository.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/7036693291108921455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/7036693291108921455'/><link rel='alternate' type='text/html' href='http://linuxsysint.blogspot.com/2009/01/custom-yum-repos.html' title='Custom Yum Repos'/><author><name>G. Ryan Fawcett</name><uri>http://www.blogger.com/profile/07681472878702166327</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEzIDTqwXU1ThG2xrsSjilH2duHyz3LpLiC7Q-1YqX_nmmdDOEgebavfT31pVKCw4mSLq7NMSM5Xx9R4l8yrWDU1x-u8r4FTVUr12o881Rriv4r_V8WAAQ7Q1j6mq_noe9Q3nfHQrhOoAoZbAW36mODy7-ywV6qTCIWkY1Xx8o30tV9A/s220/Profile.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5767132627703609738.post-1120849145440907585</id><published>2008-12-31T15:43:00.001-08:00</published><updated>2008-12-31T17:21:01.472-08:00</updated><title type='text'>Defending SSH Brute Force Attacks</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;I noticed &lt;span style=&quot;font-family:arial;&quot;&gt;allot of invalid user trying to login to my ssh box on the internet rather then changing my port or doing something else I opted to create an ssh script that denies all traffic coming from an IP who is trying to login with an invalid user. There are a couple requirements for the script.  The primary IP needs to be on Eth0 interface and iptables has to be enabled on the box.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;Here is the basic script that searches /var/log/messages for bad ssh attempts and adds a new iptables drop rule for each ip.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;chmod 700&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;########## /root/Badssh.sh ############&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;!/bin/bash&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#Badssh Audit Version 1.0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#Info-struct security system Inc.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#Authored Ryan Fawcett Gryanfawcett @ gmail dot com&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;TEMP=`grep sshd /var/log/messages | grep &quot;Invalid user&quot;  | awk {&#39;print $10&#39;} | sort -u`;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;echo &quot;######Badssh.sh rules#########&quot; &gt;&gt;/etc/rc.d/badssh-ips.sh;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;for ip in $TEMP&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;do&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;echo &quot;\$IPTABLES -A INPUT -i \$EXT_INT -s&quot; $ip&quot;/32 -j DROP&quot; &gt;&gt;/etc/rc.d/badssh-ips.ssh;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;done&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;sleep 2&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;/etc/rc.d/badssh-ips.ssh;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is the script that searches the logs and then appends the bad ips to the iptables rule set. You will need to clean up the script once in a while and I suggest setting up ssh keys to avoid locking yourself out by fat fingering your login.&lt;br /&gt;&lt;br /&gt;chmod 700&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;####### /etc/rc.d/badssh-ips.sh #########&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#!/bin/sh&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;# Ryan fawcett gryanfawcett at Gmail dot com 2001&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;# this script clears existing firewall rules and sets new rules&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;export EXT_IP=&quot;`/sbin/ifconfig eth0 | grep &#39;inet addr&#39; | awk &#39;{print $2}&#39; | sed&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;-e &#39;s/.*://&#39;`&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;###### Roots Crontab ########&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;0,15,30,45 * * * *  /root/badssh.sh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/1120849145440907585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/1120849145440907585'/><link rel='alternate' type='text/html' href='http://linuxsysint.blogspot.com/2008/12/defending-ssh-brute-force-attacks.html' title='Defending SSH Brute Force Attacks'/><author><name>G. Ryan Fawcett</name><uri>http://www.blogger.com/profile/07681472878702166327</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEzIDTqwXU1ThG2xrsSjilH2duHyz3LpLiC7Q-1YqX_nmmdDOEgebavfT31pVKCw4mSLq7NMSM5Xx9R4l8yrWDU1x-u8r4FTVUr12o881Rriv4r_V8WAAQ7Q1j6mq_noe9Q3nfHQrhOoAoZbAW36mODy7-ywV6qTCIWkY1Xx8o30tV9A/s220/Profile.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5767132627703609738.post-4813662702294642973</id><published>2008-12-24T12:18:00.000-08:00</published><updated>2008-12-26T23:49:01.508-08:00</updated><title type='text'>Rsync Passwords and other Tidbits</title><content type='html'>I like Rsync allot and I tend to use it allot in daemon mode.  I like to run it from Cron so that I know about every 1 to 5 min it back up certain files.  Using it like this can be tricky b/c I also want to use some extra security, another thing is I don&#39;t want it to eat all up all my network bandwidth when syncing remotely with servers.  So today we are going to Show you how to secure your Rsync with passwords, and limit bandwidth connections.&lt;br /&gt;&lt;br /&gt;Lets start out with the basic config first.&lt;br /&gt;This example is to rsync my pxe images directory.&lt;br /&gt;#rsyncd.conf&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;uid = nobody&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;gid = nobody&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;use chroot = yes&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;max connections = 4&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;syslog facility = local5&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;pid file = /var/run/rsyncd.pid&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;[images]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;path = /var/www/html/install/images&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;comment = whole linux image area (approx 6.1 GB)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Nothing special here just basic setup&lt;br /&gt;But lets get fancy&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Using  Rsync Passwords&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Here is the same config with rsync&#39;s own authentication configured.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#rsyncd.conf with auth&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;uid = nobody&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;gid = nobody&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;use chroot = yes&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;max connections = 4&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;syslog facility = local5&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;pid file = /var/run/rsyncd.pid&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;[images]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;path = /var/www/html/install/images&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;comment = whole linux image area (approx 6.1 GB)&lt;/span&gt;&lt;span style=&quot;font-style: italic;font-family:monospace;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;auth users = miuser nobody&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;secrets file = /etc/rsyncd.secrets&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#rsyncd.secrets &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;miuser:passw0rd&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;nobody:passw0rd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Remember to make sure there is non-world readable on the secrets file&lt;br /&gt;just to make sure and rest easy.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;chmod 700 /etc/rsyncd.secrets&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now lets move to the client side we need to setup a password file so we can run this whole thing from a cronjob.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;#pass&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;passw0rd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Just like secrets file you need to make it non-world readable&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;chmod 700 pass&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then give it a shot&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;rsync -avz --password-file=./pass miuser@yourserver.yourdomain.org::images/* /tftp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There you can add that to a cron job put it in a wrapper script or something else, now only authenticated clients can access rsync targets.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Bandwidth Limiting&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Another handy option is to limit the bandwidth when rsyncing, b/c you don&#39;t want to saturate your pipe between Data centers or networks.  From the man page it says&lt;br /&gt;&lt;br /&gt;--bwlimit=KBPS&lt;br /&gt;       This  option allows you to specify a maximum trans­&lt;br /&gt;       fer rate in kilobytes per second.  This  option  is&lt;br /&gt;       most  effective  when  using rsync with large files&lt;br /&gt;       (several megabytes and up). Due to  the  nature  of&lt;br /&gt;       rsync  transfers,  blocks of data are sent, then if&lt;br /&gt;       rsync determines the transfer was too fast, it will&lt;br /&gt;       wait before sending the next data block. The result&lt;br /&gt;       is an average transfer rate equaling the specified&lt;br /&gt;       limit. A value of zero specifies no limit.&lt;br /&gt;&lt;br /&gt;This trick is very useful here is an example of it&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;rsync -avz  --bwlimit=300 --password-file=./pass miuser@yourserver.youdomain.org::images/* /tftp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/4813662702294642973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/4813662702294642973'/><link rel='alternate' type='text/html' href='http://linuxsysint.blogspot.com/2008/12/rsync-password-and-other-tidbits.html' title='Rsync Passwords and other Tidbits'/><author><name>G. Ryan Fawcett</name><uri>http://www.blogger.com/profile/07681472878702166327</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEzIDTqwXU1ThG2xrsSjilH2duHyz3LpLiC7Q-1YqX_nmmdDOEgebavfT31pVKCw4mSLq7NMSM5Xx9R4l8yrWDU1x-u8r4FTVUr12o881Rriv4r_V8WAAQ7Q1j6mq_noe9Q3nfHQrhOoAoZbAW36mODy7-ywV6qTCIWkY1Xx8o30tV9A/s220/Profile.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5767132627703609738.post-1001713596384332273</id><published>2008-12-17T16:49:00.000-08:00</published><updated>2008-12-17T19:54:53.061-08:00</updated><title type='text'>RHEL 5 Simple Authentication via LDAP over TLS</title><content type='html'>One of the most interesting challenges I had in recent months is figuring out how to setup simple LDAP authentication via TLS on RHEL 5.  I found little documentation for setting this up.  I couldn’t find anything that took it from setting up a basic CA to testing and debugging issues you might run into. So the thought is I will be extremely useful to document this for other people&lt;br /&gt;Some you need the following component to get this to work&lt;br /&gt;&lt;br /&gt;Installing the packages&lt;br /&gt;&lt;br /&gt;Creating a Certificate authority&lt;br /&gt;&lt;ul&gt;&lt;li&gt;     Creating CA&lt;/li&gt;&lt;li&gt;      Creating Server Certs&lt;/li&gt;&lt;li&gt;    Testing and Debuging CA Certs&lt;/li&gt;&lt;/ul&gt;LDAP TLS configuration&lt;br /&gt;&lt;ul&gt;&lt;li&gt;    Slapd.conf&lt;/li&gt;&lt;li&gt;    Ldap.conf&lt;/li&gt;&lt;li&gt;    Testing and Debugging&lt;/li&gt;&lt;/ul&gt;Schema&lt;br /&gt;&lt;ul&gt;&lt;li&gt;    Adding the LDIF components to LDAP for OU people and adding a user.&lt;/li&gt;&lt;li&gt;    Adding users&lt;/li&gt;&lt;li&gt;PAM/nscd configuring using LDAP tools&lt;/li&gt;&lt;/ul&gt;    Nscd configuration&lt;br /&gt;&lt;ul&gt;&lt;li&gt;    Auth-config-tui&lt;/li&gt;&lt;/ul&gt;Ready lets get started please Yum install the following packages&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Yum install openldap*&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Yum install system-config*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ok great now lets move on to the next step.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;CA Configuration&lt;/span&gt;&lt;br /&gt;Unlike ever other document I found out there the CA.sh script was nowhere to be found on the /usr/share/openldap instead in RHEL 5 its been moved to /etc/pki/tls/misc/ this will create the Certificate authority in /etc/pki/CA  because the default openssl configuration for RHEL 5 puts it there.&lt;br /&gt;&lt;br /&gt;Run the script&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;br /&gt;Bash# ./CA  -newca&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Making CA certificate ...&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Using configuration from /etc/pki/tls/openssl.cnf&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Generating a 1024 bit RSA private key&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;..........................++++++&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;.........................++++++&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;writing new private key to &#39;./demoCA/private/./cakey.pem&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Enter PEM pass phrase: &lt;/span&gt;&lt;ca pass=&quot;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Verifying password - Enter PEM pass phrase: &lt;/span&gt;&lt;ca pass=&quot;&quot; again=&quot;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Country Name (2 letter code) [AU]:US&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;State or Province Name (full name) [Some-State]:&lt;/span&gt;&lt;your state=&quot;&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; example CA&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Locality Name (eg, city) []: &lt;/span&gt;&lt;your city=&quot;&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; example SF&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Organization Name (eg, company) [Internet Widgits Pty Ltd]: &lt;/span&gt;&lt;company or=&quot;&quot; org=&quot;&quot; name=&quot;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Organizational Unit Name (eg, section) []: I leave this blank just hit hard return&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Common Name (eg, YOUR name) []:&lt;/span&gt;&lt;your domain=&quot;&quot; com=&quot;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Email Address []:. &lt;/span&gt;&lt;ldap@mycompany.com&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now your public key will be located in /etc/pki/CA/cacert.pem you will need this latter.&lt;br /&gt;&lt;br /&gt;B/C of the screwy configuration of openssl.conf you need to change directory to&lt;br /&gt;/etc/pki/tls/misc&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Creating Sever Certificates&lt;/span&gt;&lt;br /&gt;Now you need to create the server cert and key for the LDAP server to use.&lt;br /&gt;Its really important that you setup the cn name to be the domain of your server not a FQD Host.  Example example.com (Domain )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;bash# openssl req -newkey rsa:1024 -nodes -keyout newreq.pem -out newreq.pem&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Using configuration from /etc/pki/openssl.cnf&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Generating a 1024 bit RSA private key&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;..............++++++&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;..........................++++++&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;writing new private key to &#39;newreq.pem&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;-----&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;You are about to be asked to enter information that will be incorporated&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;into your certificate request.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;What you are about to enter is what is called a Distinguished Name or a DN.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;There are quite a few fields but you can leave some blank&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;For some fields there will be a default value,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;If you enter &#39;.&#39;, the field will be left blank.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;-----&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Country Name (2 letter code) [AU]:US&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;State or Province Name (full name) [Some-State]: ]:&lt;/span&gt;&lt;your state=&quot;&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; example CA&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Locality Name (eg, city) []:  your city example SF&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Organization Name (eg, company) [Internet Widgits Pty Ltd]: &lt;/span&gt;&lt;company or=&quot;&quot; org=&quot;&quot; name=&quot;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Organizational Unit Name (eg, section) []:  any sub domain&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Common Name (eg, YOUR name) []:  enter server host name example server.domain.com&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Email Address []: &lt;/span&gt;&lt;your org=&quot;&quot; email=&quot;&quot; address=&quot;&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; example ldapadmin@domain.com&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Please enter the following &#39;extra&#39; attributes&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;to be sent with your certificate request&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;A challenge password : &lt;/span&gt;&lt;pass&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;An optional company name  :.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It will produce newreq.pem in the current directory.&lt;br /&gt;Now you need to sign the certificates&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;/etc/pki/tls/misc/CA.sh –sign&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Using configuration from /etc/ssl/openssl.cnf&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Enter PEM pass phrase: &lt;/span&gt;&lt;ca pass=&quot;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Check that the request matches the signature&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Signature ok&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;The Subjects Distinguished Name is as follows&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;countryName :PRINTABLE:&#39;US&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;stateOrProvinceName :PRINTABLE:&#39;State&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;localityName :PRINTABLE:&#39;City&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;organizationName :PRINTABLE:&#39;Example Org&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;organizationalUnitName:PRINTABLE:&#39;Example yourdomain&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;commonName :PRINTABLE:’server.youdomain.com&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;emailAddress :IA5STRING:&#39;ldap@myserver.com&#39;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Certificate is to be certified until Apr 10 18:58:58 2004 GMT (365 days)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Sign the certificate? [y/n]:y&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now you need to take the newreq.pem and newcert.pem and move them with the CA cert to cacerts place for ldap to read the certs from.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Cp /etc/pki/CA/cacert.pem /etc/openldap/cacerts/&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Cp /etc/pki/tls/misc/newcert.pem /etc/openldap/cacerts/servercrt.pem&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Cp /etc/pki/tls/misc/newreq.pem /etc/openldap/cacerts/serverkey.pem&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now lets test the certs to make sure everything is good before we go installing them.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;openssl verify -CAfile ./cacert.pem servercrt.pem&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;servercrt.pem: OK&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Distribute Cacert.pem to all the client machines&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Scp /etc/openldap/cacerts/cacert.pem user@host:/etc/openldap/cacerts/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Configuring Slapd.conf&lt;/span&gt;&lt;br /&gt;This is the configuration for the server and&lt;br /&gt;This part is kind of tricky but I will give you some help on debugging so if you run into issues let me know.&lt;br /&gt;&lt;br /&gt;Uncomment or change the following lines.&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;br /&gt;Allow bind_v2&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Base dc=yourdomain,dc=org&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;TLSCACertificateFile /etc/openldap/cacerts/cacert.pem&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;TLSCertificateFile /etc/openldap/cacerts/servercrt.pem&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;TLSCertificateKeyFile /etc/openldap/cacerts/serverkey.pem&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;access to *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;by self write&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;by users read&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;by anonymous auth&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;database    bdb&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;suffix        &quot;dc=yourdomain,dc=org&quot; &lt;/span&gt;&lt;example dc=&quot;yahoo,dc=com&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    binddn          “cn=Manager,dc=yourdomain,dc=org”&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    bindpw     secret&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    tls_cacertdir     /etc/openldap/cacerts&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    tls_CACERT      /etc/openldap/cacerts/cacert.pem&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    tls_REQCERT  demand&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    ssl start_tls&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    uri ldap://yourserver.yourdomain.org/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now restart ldap&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;br /&gt;Service ldap restart&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Configure LDAP Client ldap.conf&lt;/span&gt;&lt;br /&gt;Now on the server as well as client you should configure ldap.conf&lt;br /&gt;This is the client configuration stored in /etc/ldap.conf&lt;br /&gt;Uncomment or change the following lines&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;br /&gt;base dc=yourdomain,dc=org&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;binddn cn=Manager,dc=yourdomain,dc=org&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;bindpw secret&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;ssl start_tls&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;tls_checkpeer yes&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;tls_cacertfile /etc/openldap/cacerts/cacert.pem&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;tls_cacertdir /etc/openldap/cacerts/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Testing the configuration / Debugging&lt;/span&gt;&lt;br /&gt;Lets test to make sure the SSL is working.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;openssl s_client -connect server.yourdomain.org:636 -CAfile /etc/openldap/cacerts/cacert.pem&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You should get something like this.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;SSL-Session:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    Protocol  : TLSv1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    Cipher    : AES256-SHA&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    Session-ID: 69E38A9BFB51A39EB174B95974FA42D37E101F1F65CF396DC86AB088C9910F58&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    Session-ID-ctx:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    Master-Key: E8CA2A9EBB8258F0A7A39C4167C8190C96DBCE835BD88A2DE44ABA05425B67276203C877464656022A4D65879438E31A&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    Key-Arg   : None&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    Krb5 Principal: None&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    Start Time: 1229577041&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    Timeout   : 300 (sec)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    Verify return code: 0 (ok)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This verifies that the CA Certs are working and clients can connect via TLS.&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;br /&gt;ldapsearch -x -b &quot;dc=yourdomain,dc=org&quot; -D &quot;cn=Manager,dc=yourdomain,dc=org&quot; &#39;(objectclass=*)&#39; -H ldap://ldap.myserver.org -W -ZZ&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The password is the password in your slapd.conf in this case secret.&lt;br /&gt;&lt;br /&gt;The –W and –ZZ Forces TLS with password authentication if it says it fails to connect run the following command to see the reason.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;ldapsearch  -d -1 -x -b &quot;dc=yourdomain,dc=org&quot; -D &quot;cn=Manager,dc=yourdomain,dc=org&quot; &#39;(objectclass=*)&#39; -H ldap://ldap.myserver.org -W –ZZ&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The –d -1 tell ldapsearch to go into debug mode with debug level -1&lt;br /&gt;This is handy to figure out why it doesn’t work. Then you can debug from there.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Schema Changes&lt;/span&gt;&lt;br /&gt;Changes the schema is kinda of important allows for you to use the migrate scripts.&lt;br /&gt;You need to add the people.ldif&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;dn: ou=people,dc=yourdomain,dc=org&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;objectClass: organizationalUnit&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;ou: people&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;ldapadd –x –D “cn=Manager,dc=yourdomain,dc=org” –W –f people.ldif&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Adding Users&lt;/span&gt;&lt;br /&gt;Adding users is pretty easy do the normal  useradd procedure on the ldap server in Unix and then grep out the password and run the migration script.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Useradd username&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Passwd password&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;grep username /etc/passwd &gt;username.passwd&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;/usr/share/openladp/migration/migrate_passwd username.passwd usrname.ldif&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now all you have to do is add the user.ldif to the directory&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Ldapadd –x –D “cn=Manager,dc=yourdomain.,dc=org” –W –f username.ldif&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Restart ldap on the server&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;br /&gt;Service Ldap restart&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Configuring PAM and nscd Deamon&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The quickest way to get things running is to cop the ldap.conf file to the client and make sure you have the CA cert in the right place and the rootdn and rootpasswd set in the ldap.conf.&lt;br /&gt;&lt;br /&gt;Then simply run the authconfig-tui from the command line.&lt;br /&gt;Under user information&lt;br /&gt;Select use LDAP&lt;br /&gt;&lt;br /&gt;Under Authentication select&lt;br /&gt;Select  USE Shadow Password&lt;br /&gt;Select  USE LDAP Authentication&lt;br /&gt;Select Local Authorization is sufficient ( this way you don’t lock yourself out. )&lt;br /&gt;&lt;br /&gt;Next Click Next&lt;br /&gt;Select TLS&lt;br /&gt;Server: ldap://yourserver.yourdomain.org/&lt;br /&gt;Dc=yourdomain,dc=org&lt;br /&gt;Click ok.&lt;br /&gt;&lt;br /&gt;Now restart nscd&lt;br /&gt;Service nscd restart&lt;br /&gt;Check /var/log/messages to make sure that you don’t get any binding errors&lt;br /&gt;Login with the LDAP user name and password&lt;br /&gt;&lt;br /&gt;There you go.  If you have any problems with the instructions email me at gryanfawcett at gmail dot com.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ca&gt;&lt;ca&gt;&lt;your&gt;&lt;your&gt;&lt;company&gt;&lt;your&gt;&lt;ldap@mycompany.com&gt;&lt;your&gt;&lt;company&gt;&lt;your&gt;&lt;pass&gt;&lt;ca&gt;&lt;example dc=&quot;yahoo,dc=&quot; com=&quot;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/example&gt;&lt;/ca&gt;&lt;/pass&gt;&lt;/your&gt;&lt;/company&gt;&lt;/your&gt;&lt;/ldap@mycompany.com&gt;&lt;/your&gt;&lt;/company&gt;&lt;/your&gt;&lt;/your&gt;&lt;/ca&gt;&lt;/ca&gt;&lt;/example&gt;&lt;/ca&gt;&lt;/pass&gt;&lt;/your&gt;&lt;/company&gt;&lt;/your&gt;&lt;/ldap@mycompany.com&gt;&lt;/your&gt;&lt;/company&gt;&lt;/your&gt;&lt;/your&gt;&lt;/ca&gt;&lt;/ca&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/1001713596384332273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/1001713596384332273'/><link rel='alternate' type='text/html' href='http://linuxsysint.blogspot.com/2008/12/rhel-5-simple-authentication-via-ldap.html' title='RHEL 5 Simple Authentication via LDAP over TLS'/><author><name>G. Ryan Fawcett</name><uri>http://www.blogger.com/profile/07681472878702166327</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEzIDTqwXU1ThG2xrsSjilH2duHyz3LpLiC7Q-1YqX_nmmdDOEgebavfT31pVKCw4mSLq7NMSM5Xx9R4l8yrWDU1x-u8r4FTVUr12o881Rriv4r_V8WAAQ7Q1j6mq_noe9Q3nfHQrhOoAoZbAW36mODy7-ywV6qTCIWkY1Xx8o30tV9A/s220/Profile.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5767132627703609738.post-1100923182576808656</id><published>2008-12-10T14:47:00.000-08:00</published><updated>2011-05-19T11:24:51.629-07:00</updated><title type='text'>RPM FOO Creating RPMS from Tar files</title><content type='html'>Working in Linux shops for years, one of the most challenging obstacles is coming out with a way to manage and maintain standard software and configurations across multiple servers. Using RPMS To distribute configurations via YUM and automated Installs via Kick-start.  Is a good system management practice and has many advantages over other distribution methods.&lt;br /&gt;&lt;br /&gt;Most of these examples, I list below don&#39;t need any pre or post scripts to deploy but just a good way to check versions, track, install and remove packages.&lt;br /&gt;&lt;br /&gt;The following are some of the uses I use custom RPMS for.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SSH Keys&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Web Site Releases&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Standard System Configurations&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;And a million other things.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The advantages to using RPMS  are numerous and ,well, lets just say it brings a lot more sanity to a chaotic world of system administration. RPM&#39;s most notable purpose is to install and back out of releases and configurations in a structured and organized manner.&lt;br /&gt;&lt;br /&gt;But then again, its said that building and maintaining RPM packages has a high learning curve, and building RPM spec files is somewhat of a black art.&lt;br /&gt;&lt;br /&gt;So here are the simple method to build your own RPMS.&lt;br /&gt;&lt;br /&gt;On a RHEL 5 or CentOS 5 box (Probably works on RHEL 4 as well but I haven&#39;t tested it).&lt;br /&gt;&lt;br /&gt;1. Yum install rpm-build&lt;br /&gt;2. Tar up the files from the root directory ( and I don&#39;t mean /root )&lt;br /&gt;3. Copy and Paste the script from below and  save the script named bintar2rpm.&lt;br /&gt;4. chmod 755 bintar2rpm&lt;br /&gt;5. Execute the following command ./bintar2rpm Example.tar&lt;br /&gt;6. Now answer the questions Summary of the rpm package (aka what is it)&lt;br /&gt;7. Name of the rpm example.rpm&lt;br /&gt;8. Major Version meaning 1 or 2 (Numeric input )&lt;br /&gt;9. Release 0 or 1 ( So with the Major Version being 1 or 2 it will be 1.0 or 2.1)&lt;br /&gt;10. License its distributed under: Privately, FreeBSD or GPL V2/V3&lt;br /&gt;&lt;br /&gt;Sit back and watch it build the RPM for you on the hardware platform you are on.&lt;br /&gt;It usually puts it the rpm in /usr/src/RPMS/$ARCH&lt;br /&gt;&lt;br /&gt;Thanks to Bart Scaefer to a good patch that makes this work more like it was designed to.&lt;br /&gt;As well as he added gzip support for the tar files.&lt;br /&gt;&lt;br /&gt;There you go an RPM package in under a minute.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;#Created by G. Ran Fawcett of Info-struct Systems&lt;br /&gt;#Edited to support gzip&#39;d tar files and alternate install path&lt;br /&gt;# by Bart Schaefer&lt;br /&gt;#For support and assistance contact gryanfawcett at gmail dot com&lt;br /&gt;#Licnced under GPL v3&lt;br /&gt;#Version 1.0-b&lt;br /&gt;# Reason for using all system calls is to make this portable without any additional modules&lt;br /&gt;if ( ! -e &#39;/usr/bin/rpmbuild&#39;)&lt;br /&gt;{&lt;br /&gt;print &quot;Missing Build Tools or Build Environment please install rpm-build&quot;;&lt;br /&gt;exit 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if ( $ARGV[0] eq &#39;&#39; )&lt;br /&gt;{&lt;br /&gt;print &quot;Error Missing tar file: try -h for usage\n&quot;;&lt;br /&gt;exit 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if ($ARGV[0] eq &#39;-h&#39;)&lt;br /&gt;{&lt;br /&gt;print &quot;bintar2rpm Package by G. Ryan Fawcett gryanfawcett at gmail dot com\n&quot;;&lt;br /&gt;print &quot;Usage: bintar2rpm example.tar installdir\n&quot;;&lt;br /&gt;exit 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$BuildRoot = &quot;/tmp/bintar2rpm$$&quot;;&lt;br /&gt;&lt;br /&gt;$TarPackage = $ARGV[0];&lt;br /&gt;if ( $TarPackage =~ /gz$/ )&lt;br /&gt;{&lt;br /&gt;$tarOpts = &#39;zf&#39;;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;$tarOpts = &#39;f&#39;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$ExtractTo = $ARGV[1] || &quot;/&quot;;&lt;br /&gt;if ( $ExtractTo !~ m:^/: )&lt;br /&gt;{&lt;br /&gt;print &quot;Install directory must be a full path from the root\n&quot;;&lt;br /&gt;exit 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;system(&quot;mkdir -p $BuildRoot$ExtractTo&quot;);&lt;br /&gt;@FileList = `tar -C $BuildRoot$ExtractTo -xv$tarOpts $TarPackage 2&amp;gt;/dev/null`;&lt;br /&gt;&lt;br /&gt;if ( $ExtractTo !~ m:/$: )&lt;br /&gt;{&lt;br /&gt;$ExtractTo .= &quot;/&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;print &quot;Summary: &quot;;&lt;br /&gt;$Summary = %3CSTDIN%3E%0A &lt;stdin&gt;;&lt;br /&gt;chomp $Summary;&lt;br /&gt;print &quot;Name: &quot;;&lt;br /&gt;$Name = &lt;stdin&gt; ;&lt;br /&gt;chomp $Name;&lt;br /&gt;print &quot;Version: &quot;;&lt;br /&gt;$Version = &lt;stdin&gt;;&lt;br /&gt;chomp $Version;&lt;br /&gt;print &quot;Release: &quot;;&lt;br /&gt;$Release = &lt;stdin&gt;;&lt;br /&gt;chomp $Release;&lt;br /&gt;print &quot;License: &quot;;&lt;br /&gt;$License = &lt;stdin&gt;;&lt;br /&gt;chomp $License;&lt;br /&gt;$Group = &#39;Application/Production&#39;;&lt;br /&gt;$ARCH = `uname -i`;&lt;br /&gt;chomp $ARCH;&lt;br /&gt;&lt;br /&gt;$FileOutput = &quot;$Name&quot; . &quot;-&quot; . &quot;$Version&quot; . &quot;-&quot; . &quot;$Release&quot; . &quot;\.&quot; . &quot;$ARCH&quot; . &quot;\.spec&quot;;&lt;br /&gt;&lt;br /&gt;open(SpecFile, &quot;&amp;gt;$FileOutput&quot;);&lt;br /&gt;print SpecFile &quot;Name: $Name\n&quot;;&lt;br /&gt;print SpecFile &quot;Summary: $Summary\n&quot;;&lt;br /&gt;print SpecFile &quot;Version: $Version\n&quot;;&lt;br /&gt;print SpecFile &quot;Release: $Release\n&quot;;&lt;br /&gt;print SpecFile &quot;License: $License\n&quot;;&lt;br /&gt;print SpecFile &quot;Group: $Group\n&quot;;&lt;br /&gt;print SpecFile &quot;Source: $TarPackage\n&quot;;&lt;br /&gt;print SpecFile &quot;Requires: /bin/sh\n&quot;;&lt;br /&gt;print SpecFile &quot;\%Description\n&quot;;&lt;br /&gt;print SpecFile &quot;The following is $Name version $Version\n&quot;;&lt;br /&gt;print Specfile &quot;\n\%prep\n&quot;;&lt;br /&gt;print SpecFile &quot;\n\%setup\n&quot;;&lt;br /&gt;print SpecFile &quot;\n\%files\n&quot;;&lt;br /&gt;&lt;br /&gt;for $_ (@FileList)&lt;br /&gt;{&lt;br /&gt;$_ =~ s:^/::;&lt;br /&gt;print SpecFile &quot;$ExtractTo$_&quot;;&lt;br /&gt;}&lt;br /&gt;print SpecFile&quot;\n\%post\n&quot;;&lt;br /&gt;close(Specfile);&lt;br /&gt;&lt;br /&gt;system(&quot;cp $FileOutput /usr/src/redhat/SPECS&quot;);&lt;br /&gt;system(&quot;cp $TarPackage /usr/src/redhat/SOURCES&quot;);&lt;br /&gt;system(&quot;rpmbuild --buildroot=$BuildRoot -bb /usr/src/redhat/SPECS/$FileOutput&quot;);&lt;br /&gt;print &quot;Cleaning up ...\n&quot;;&lt;br /&gt;system(&quot;rm -rf $BuildRoot&quot;);&lt;br /&gt;&lt;/stdin&gt;&lt;/stdin&gt;&lt;/stdin&gt;&lt;/stdin&gt;&lt;/stdin&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/1100923182576808656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5767132627703609738/posts/default/1100923182576808656'/><link rel='alternate' type='text/html' href='http://linuxsysint.blogspot.com/2008/12/rpm-foo-creating-rpms-from-tar-files.html' title='RPM FOO Creating RPMS from Tar files'/><author><name>G. Ryan Fawcett</name><uri>http://www.blogger.com/profile/07681472878702166327</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEzIDTqwXU1ThG2xrsSjilH2duHyz3LpLiC7Q-1YqX_nmmdDOEgebavfT31pVKCw4mSLq7NMSM5Xx9R4l8yrWDU1x-u8r4FTVUr12o881Rriv4r_V8WAAQ7Q1j6mq_noe9Q3nfHQrhOoAoZbAW36mODy7-ywV6qTCIWkY1Xx8o30tV9A/s220/Profile.jpg'/></author></entry></feed>