Advertise with Googlier.com Allan Feid - Linux https://allanfeid.com/category/tags/linux en Create an inventory tool using MCollective's registration feature https://allanfeid.com/content/create-inventory-tool-using-mcollectives-registration-feature <div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I started working at a company (Shutterstock) that had <a href="http://docs.puppetlabs.com/mcollective/" title="mcollective home page">MCollective</a> implemented a few months ago. We use it to perform various functions across a wide range of servers. Things such as rolling the application servers to pick up new code, clearing caches, checking replication lag on databases, telling our puppetmaster to sign certificates, and even doing code deployment. There are endless possibilites with this system, and it is so simple to write your own agent/client utilities, that I'm not sure why more people aren't using MCollective. One of the things we were lacking was a central inventory of our systems in an easy to view manner. Thankfully, <a href="http://www.devco.net/" title="R.I. Pienaar's Blog">R.I. Pienaar's</a> MCollective has a great feature called registration. Essentially, it causes your nodes to blast out to an ActiveMQ/rabbitmq topic at a set interval, and any node configured to listen can read that data and perform actions based on that data. With that in mind, I set out to create a database of information.</p> <h2>Setting up a registration plugin</h2> <p>Taking a look at <a href="https://github.com/puppetlabs/mcollective-plugins/blob/master/registration/meta.rb" title="mcollective-plugins on github">this registration plugin</a>, you can begin to see how easy generating your data set is. From this example, you get MCollective's agentlist, facts, and classes sent during registration. I wanted to also report on virtual machines running on hypervisors with an in-house libvirtd agent. To achieve that, your agent needs to have a simple method that can be called without the request/reply data structures. An example of that would be this:</p> <pre><code>module MCollective module Agent class Custom&lt;RPC::Agent def some_method # gather some data and return it end end end end </code></pre><p>Once your agent has a method that can simply be called, you can call this method inside your registration plugin with something like this:</p> <pre><code>module MCollective module Registration class Meta&lt;Base def body result = { :agentlist =&gt; [], :facts =&gt; [], :classes =&gt; [] } cfile = Config.instance.classesfile if File.exists?(cfile) result[:classes] = File.readlines(cfile).map {|i| i.chomp} end result[:agentlist] = Agents.agentlist result[:facts] = PluginManager["facts_plugin"].get_facts if Agents.agentlist.include?("custom") # because of how PluginManager works, you need to # append _agent to the agent's name result[:custom] = PluginManager["custom_agent"].some_method end result end end end end </code></pre><p>This way your nodes can report back with literally any information that you'd like to include. I've had great success reporting on my hypervisor's available disk, memory, and CPU utilization as well as what virtual machines are running.</p> <h2>What do you do with this data?</h2> <p>With inspiration from <a href="https://github.com/puppetlabs/mcollective-plugins/blob/master/agent/registration-mongodb/registration.rb" title="mcollective-plugins on github">this mongodb registration agent</a>, I decided MongoDB was a pretty good way to store data that was dynamicly generated. I wanted to make it easy to store/retrieve data as I saw fit, so using <a href="http://mongoid.org/" title="Mongoid's home page">Mongoid</a> seemed like the way to go. Something as simple as this is all you really need:</p> <pre><code>class Node include Mongoid::Document include Mongoid::Timestamps field :hostname, :unique =&gt; true, :type =&gt; String index :hostname validates_uniqueness_of :hostname end </code></pre><h2>Improving performance with a queue</h2> <p>After running registration for a bit, memory usage by mcollective began to skyrocket on the machine processing the data, and eventually I started seeing timeouts or pool limits being hit on my mongo connection. I was able to talk a bit with R.I. Pienaar on IRC, and he informed me that every request that a node recieves spawns a new thread for an agent to run in. This is not scalable for the registration process, and once you hit over about 100 nodes, you run into problems since your machine is constantly opening up new threads to handle registration data. He did offer a solution that he uses personally and has suggested to others. That is to use a queue rather than a topic, and to have a simple daemon dedicated to processing registration data. There's some <a href="http://devco.net/rip/mcollective-registration-receiver.rb">sample code available on his website</a>, and I'm sure this will be included in the main application at some point. In order to get this working I did need to change my ActiveMQ configuration a bit, but the change was simple and just required adding a new line similar to this:</p> <pre><code>&lt;authorizationEntry queue="mcollective.&gt;" write="admins" read="admins" admin="admins" /&gt; </code></pre><p>Basically the mcollective user that you use from the client side needs to be able to read/write to the new queue. This also requires that your registration plugin sends the result out to the queue rather than a topic. Another simple change:</p> <pre><code>module MCollective module Registration class Meta&lt;Base def body ... PluginManager["connector_plugin"].connection.publish("/queue/mcollective.registration", result.to_json) nil end end end end </code></pre><p>By having the body method return nil, you won't send anything out to the standard registration topic, which would be redundant in this case.</p> <h2>The end result</h2> <p>With a bit of tweaking, I was able to get my registration daemon/agent saving data into mongo in less than a second per request recieved. Once I had all that data in place, I was able to implement a slick interface using Sinatra and Bootstrap that gives me good insight into our inventory. I'll probably go more into the frontend interface when it becomes more mature, but once you have all this data, it's up to you to decide what you want to do with it.</p> </div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags:&nbsp;</h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/mcollective" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">MCollective</a></li><li class="field-item odd"><a href="/category/tags/ruby" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Ruby</a></li><li class="field-item even"><a href="/category/tags/linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Linux</a></li><li class="field-item odd"><a href="/category/tags/sysadmin" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">sysadmin</a></li><li class="field-item even"><a href="/category/tags/devops" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">devops</a></li></ul></section> Sat, 08 Oct 2011 22:05:09 +0000 Allan Feid 75 at https://allanfeid.com Capistrano for the sysadmin https://allanfeid.com/content/capistrano-sysadmin <div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><p>There's always been a fine line between a good sysadmin and a programmer. Capistrano is software built for Ruby on Rails to make deploys across multiple servers easy, however, the potential is much greater than just code deployment. I have recently grown in love with how easily I can run commands across groups of servers, and setting up Capistrano is not a difficult task. If you've ever configured password-less SSH access, you can get this up and running without much difficulty.</p> <h2>Have a centralized ssh-key</h2> <pre><code># ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/root/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_dsa. Your public key has been saved in /root/.ssh/id_dsa.pub. </code></pre><p>You have an SSH key, now you just need to install it on each server you would like to manage. One of the things I like to do, is setup an rsync share to pull down important config files. This can also be easily accomplished using an NFS mount. Either way after you have password-less SSH access to all the servers from one location, this will be your controlling server. You won't need to login to the other boxes individually from this point forward.</p> <p><strong>Security note</strong>: <em>in this example, I'm using root logins. I recommend setting <code class="prettyprint">PermitRootLogin</code> to <code class="prettyprint">without-password</code> if you want to use root access, however, I really do not recommend using root directly, as it becomes a liability issue when you have more than one admin. The use of a normal user account plus sudo is highly recommended.</em></p> <h2>Install the software</h2> <p>Depending on what OS you're on, these steps may be different, but the end goal is the same: get RubyGems installed. On CentOS/RHEL the following works:</p> <pre><code># yum install -y ruby ruby-devel ruby-rdocs ruby-ri </code></pre><p>Since the version of ruby included on CentOS/RHEL is a bit dated, we have to use an older version of RubyGems (1.3.5).</p> <pre><code># wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz # tar xzf rubygems-1.3.5.tgz # cd rubygems-1.3.5/ # ruby setup.rb # gem install capistrano </code></pre><h2>Configuring Capistrano</h2> <p>At this point, a Rails developer would cd into their code directory, run capify and configure Capistrano's deploy scripts to their needs. Going over code deployments is an entirely different process, which I'll save for another time. As a sysadmin, we can skip running capify and just make our own cap file. Think of a cap file as a basic config file, except written in Ruby. You get the power of a scripting language built right into your config file. This truly gives you endless options and the ability to tie into anything you'd like (think database, or ldap). Here I'll show you a basic "cap file" that will do what sysadmins want: make managing multiple servers easy.</p> <pre><code># cd /etc/manage # ls -l -rw-r--r-- 1 root root 2739 Jul 20 18:14 capfile drwxr-xr-x 2 root root 4096 Jul 19 12:15 roles/ # cat capfile def getrole(role) f = open('/etc/manage/roles/' + role) f.readlines end role(:web) { getrole('web') } role(:db) { getrole('db') } desc "Show Memory" task :show_mem do run "grep -i memtotal /proc/meminfo" end </code></pre><p>What I like to do is create a directory (/etc/manage/), then populate this with central management type configurations. In this case, it would be my cap file, and a directory called roles. The roles directory just contains files with lists of servers, for example:</p> <pre><code># cat /etc/manage/roles/web web1 web2 web3 </code></pre><p>So this would be the resolvable names of all my web servers. The cap file uses a basic function called <code class="prettyprint">getrole()</code> to read the file declared by role inside the roles directo One would be to cd into /etc/manage and the other would be to declare the cap file from the command line with the -f parameter. The first thing you can look at, is the output of <code class="prettyprint">-T</code>.</p> <pre><code># cap -T cap invoke # Invoke a single command on the remote servers. cap shell # Begin an interactive Capistrano session. cap show_mem # Show Memory </code></pre><p>This will show you all the different tasks you have available. There are two built in ones (invoke, shell) and one we defined in our cap file (<code class="prettyprint">show_mem</code>). This is a very basic example, but will suite a wide range of needs. The most useful, in my opinion (at least at this stage), is the shell. This is where you have the power to run commands across "roles" of servers.</p> <pre><code># cap shell cap&gt; df -h ** [out :: web1] Filesystem Size Used Avail Use% Mounted on ** [out :: web1] /dev/cciss/c0d0p1 63G 8.9G 51G 15% / ** [out :: web1] tmpfs 7.9G 0 7.9G 0% /dev/shm ** [out :: web2] Filesystem Size Used Avail Use% Mounted on ** [out :: web2] /dev/cciss/c0d0p1 63G 8.9G 51G 15% / ** [out :: web2] tmpfs 7.9G 0 7.9G 0% /dev/shm ** [out :: web3] Filesystem Size Used Avail Use% Mounted on ** [out :: web3] /dev/cciss/c0d0p1 63G 8.9G 51G 15% / ** [out :: web3] tmpfs 7.9G 0 7.9G 0% /dev/shm ** [out :: db1] Filesystem Size Used Avail Use% Mounted on ** [out :: db1] /dev/cciss/c0d0p1 128G 2.6G 119G 3% / ** [out :: db1] tmpfs 2.0G 0 2.0G 0% /dev/shm cap&gt; with web cap&gt; grep admin /etc/passwd ** [out :: web1] admin:x:500:500:Admin user:/home/admin:/bin/bash ** [out :: web2] admin:x:500:500:Admin user:/home/admin:/bin/bash ** [out :: web3] admin:x:500:500:Admin user:/home/admin:/bin/bash cap&gt; with db cap&gt; !show_mem ** [out :: db1] MemTotal: 3985972 kB </code></pre><p>When you first enter the shell, it will be set to execute tasks or commands across ALL roles. Using the with directive, you can specify which role you want to use for the subsequent commands. Finally, adding a bang (!) in front, tells Capistrano to execute a task rather than standard shell commands. Hopefully I've given you enough information to apply Capistrano to your own environments. Think about commands you often execute, create a new task and you will find yourself saving a lot of time. Even troubleshooting and adding new functionality across servers becomes much quicker when you can access everything from one location.</p> </div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags:&nbsp;</h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Linux</a></li><li class="field-item odd"><a href="/category/tags/sysadmin" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">sysadmin</a></li><li class="field-item even"><a href="/category/tags/capistrano" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Capistrano</a></li><li class="field-item odd"><a href="/category/tags/ruby" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Ruby</a></li></ul></section> Sun, 09 Jan 2011 18:43:34 +0000 Allan Feid 64 at https://allanfeid.com Central login management with OpenLDAP https://allanfeid.com/content/central-login-management-openldap <div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Over the weekend I spent some time learning how to configure OpenLDAP to provide a central login server at home. This is pretty useful since I was tired of either syncing UID/GID's across servers or setting directories to 777 on my NFSv4 server. I chose Fedora 12 as my OS for the server, and will show how easy it is to configure authentication on both Fedora and OpenSolaris.</p> <h2>Some information about the network</h2> <p>I'll give you a quick overview of how the network looks from home.</p> <ul><li><strong>DNS:</strong> ns1.crazy.lan (172.16.1.3)</li> <li><strong>LDAP:</strong> ldap1.crazy.lan (10.10.1.1)</li> <li><strong>Client 1:</strong> test.crazy.lan (10.10.2.1)</li> <li><strong>Client 2:</strong> virt.crazy.lan (192.168.1.8)</li> </ul><p>I'm not going to go over the importance of DNS (both forward and reverse lookups should work!) right now, but you will save yourself plenty of headaches by making sure DNS is setup properly on your network.</p> <h2>Basic configurations</h2> <h3>Install the needed software!</h3> <p>For Fedora 12, installing OpenLDAP is easy:</p> <pre><code># yum install -y openldap* </code></pre><p>This will get you everything you need to get started.</p> <p>There are a few things you need to change in order to really start using OpenLDAP. Everything is all in one file <cite>slapd.conf</cite>. Prior to editing the file, you'll want to generate a password to use in this configuration.</p> <pre><code># slappasswd New password: Re-enter new password: {SSHA}fFVfwsztHn+xuQPjN/q/urdNC+V0G+dW </code></pre><p>Copy the new hash as you will need to paste it into the configuration file. Add or modify the following in <em>/etc/openldap/ldap.conf</em>:</p> <pre><code>suffix "dc=crazy,dc=lan" rootdn "cn=Manager,dc=crazy,dc=lan" rootpw {SSHA}fFVfwsztHn+xuQPjN/q/urdNC+V0G+dW # ACL's to use loglevel acl stats access to dn.base="" by * read access to dn.base="cn=Subschema" by * read access to * by self write by * read by anonymous auth </code></pre><p>That's all you need there for a basic configuration. This will not be using TLS/SSL, I will cover that in a later post. It's always good to start with the basics so that you can spend more time learning the protocol. Once you've gotten that down hardening a service is easy.</p> <p>Now we just need to finish up and start the service. Since <cite>slapd.conf</cite> is deprecated in favor of the <cite>slapd.d/</cite> directory, we can use the configuration file to generate the appropriate directory structure. The huge advantage of this style is <strong>dynamic backend configuration changes</strong>. Yes, that means persistent dynamic changes. No more restarting your directory server to <a href="http://blog.suretecsystems.com/archives/163-OpenLDAP-Quick-Tips-Change-loglevels-on-the-fly!.html" title="Change loglevels on the fly!">make changes to things such as your logging level</a>.</p> <pre><code># cd /etc/openldap # rm -rf slapd.d # mkdir slapd.d # slaptest -f slapd.conf -F slapd.d # chown -R ldap:ldap slapd.d # chkconfig slapd on # service slapd start </code></pre><p>You can test for functionality by running the following:</p> <pre><code>ldapsearch -x -h localhost </code></pre><p>If all went well you will see some output and no errors.</p> <h3>Configure rsyslog for logging</h3> <p>If you're not using Fedora, or rsyslog, you'll want to lookup the specifics for your logging daemon's configuration. OpenLDAP sends it's logging output to the local4 log facility. For rsyslog, just add the following line to <cite>/etc/rsyslog.conf</cite>:</p> <pre><code>local4.* -/var/log/ldap </code></pre><p>Then restart your logging service.</p> <pre><code>service rsyslog restart </code></pre><h3>Importing some data to LDAP</h3> <p>The LDIF formatted file is where things start to get a little bit tricky. Don't worry about it so much as there are plenty of good GUI clients for LDAP, but we do need to get a few things imported.</p> <pre><code># crazy.lan dn: dc=crazy,dc=lan objectClass: dcObject objectClass: organization o: Crazy Organization dc: crazy # Manager, crazy.lan dn: cn=Manager,dc=crazy,dc=lan objectClass: organizationalRole cn: manager # People, crazy.lan dn: ou=People,dc=crazy,dc=lan objectClass: organizationalUnit ou: People # Group, crazy.lan dn: ou=Group,dc=crazy,dc=lan objectClass: organizationalUnit ou: Group # users, Group, crazy.lan dn: cn=users,ou=Group,dc=crazy,dc=lan objectClass: posixGroup objectClass: top cn: users gidNumber: 2000 # myaccount, People, crazy.lan dn: uid=myaccount,ou=People,dc=crazy,dc=lan uid: myaccount objectClass: account objectClass: posixAccount objectClass: top objectClass: shadowAccount gidNumber: 2000 uidNumber: 3000 homeDirectory: /home/myaccount loginShell: /bin/bash userPassword: {SSHA}cc696ZrGCPmgx0/CD2zGJrMqR3tb8iMk cn: Allan Feid </code></pre><p>I saved the above as <cite>import.ldif</cite>. You will probably want to generate a new password with <code class="prettyprint">slappaswd</code> to use with the userPassword section above. Now to import, it all I have to do is this:</p> <pre><code>ldapadd -f import.ldif -D "cn=Manager,dc=crazy,dc=lan" -W </code></pre><p>This will prompt you for your <cite>rootdn</cite> password that you created earlier using <code class="prettyprint">slappasswd</code>. Now you have the following basic hierarchy configured:</p> <ul><li><strong>Base Domain:</strong> crazy.lan <ul><li><strong>Organizational Unit:</strong> People <ul><li><strong>User:</strong> myaccount</li> </ul></li> <li><strong>Organizational Unit:</strong> Group <ul><li><strong>Group:</strong> users</li> </ul></li> </ul></li> </ul><p>User accounts will go into the People OU, and group accounts will be assigned the Group OU. This is a pretty standard configuration as the <cite>pam_ldap</cite> plugin will look in these OU's later for user/group information.</p> <h2>Client configuration</h2> <h3>Fedora 12</h3> <p>Redhat has really made this easier than it used to be. Their <code class="prettyprint">authconfig</code> command is pretty straight forward, the following commands will get you the <code class="prettyprint">nss_ldap</code>, <code class="prettyprint">pam_ldap</code> and ldap utility commands on your client:</p> <pre><code># yum install -y openldap-clients # authconfig --enableldap \ --enableldapauth \ --disablenis \ --enablecache \ --ldapserver=ldap1.crazy.lan \ --ldapbasedn=dc=crazy,dc=lan \ --updateall </code></pre><p>That's it. You will now see the <cite>myaccount</cite> user if you run <code class="prettyprint">getent</code>.</p> <pre><code># getent passwd |grep myaccount myaccount:x:3000:2000:Allan Feid:/home/myaccount:/bin/bash </code></pre><h3>OpenSolaris</h3> <p>This should also work for plain Solaris, but I prefer OpenSolaris and haven't tested on Solaris 10. This, just like Redhat, is very easy to configure, but does require one extra step. The <code class="prettyprint">ldapclient</code> command by default copies <code class="prettyprint">/etc/nsswitch.ldap</code> to <code class="prettyprint">/etc/nsswitch.conf</code>. Which is fine, but the ldap nsswich configuration by, by default, uses ldap for hostname lookups. This is probably not desirable in most cases as that's what we use DNS for. So just change the following lines in <code class="prettyprint">/etc/nsswitch.ldap</code>:</p> <pre><code>hosts: files dns ipnodes: files dns </code></pre><p>Then just a simple command will get you up and running:</p> <pre><code># ldapclient -v manual -a defaultSearchBase=dc=crazy,dc=lan \ -a domainName=crazy.lan \ -a defaultServerList=ldap1.crazy.lan # getent passwd |grep myaccount myaccount:x:3000:2000::/home/myaccount:/bin/bas </code></pre><h3>General Configuration for client's using pam_ldap/nss_ldap</h3> <p>If you aren't using Fedora or OpenSolaris, anything that uses pam_ldap/nss_ldap can be configured pretty easily. The main configuration file for these two is <code class="prettyprint">/etc/ldap.conf</code>. All you need is to make sure you have the following lines:</p> <pre><code>base dc=crazy,dc=lan uri ldap://ldap1.crazy.lan/ </code></pre><p>Then you will have to configure nss by changing the following in <code class="prettyprint">/etc/nsswitch.conf</code>:</p> <pre><code>passwd: files ldap shadow: files ldap group: files ldap </code></pre><p>You will also need to modify your PAM configuration. Generally you will want to edit <code class="prettyprint">/etc/pam.d/system-auth</code> but this may very from OS to OS. Always check with the documentation!</p> <pre><code>auth sufficient pam_ldap.so use_first_pass </code></pre><h2>Use ADS, make your life easier!</h2> <p>I highly recommend <a href="http://directory.apache.org/studio/" title="Apache Directory Studio">Apache Directory Studio</a> as a great LDAP client. It is cross platform (java based) and having a GUI for ldap sometimes just makes more sense as you get to visualize your hierarchy easily. Setup a new connection and login as <code class="prettyprint">cn=Manager,dc=crazy,dc=lan</code> using your <cite>rootdn</cite> password. You can now easily create a template user to be copied for new users, add new groups, add OU's, etc all from a comfortable GUI.</p> <p>In upcoming posts, I plan on covering enabling TLS encryption, and eventually working on Kerberos integration with LDAP for a <cite>true</cite> Single SIgn-On (SSO) environment. If all goes well I'll share how I got it all working.</p> </div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags:&nbsp;</h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Linux</a></li><li class="field-item odd"><a href="/category/tags/opensolaris" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">OpenSolaris</a></li><li class="field-item even"><a href="/category/tags/sysadmin" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">sysadmin</a></li><li class="field-item odd"><a href="/category/tags/fedora" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Fedora</a></li><li class="field-item even"><a href="/category/tags/openldap" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">OpenLDAP</a></li><li class="field-item odd"><a href="/category/tags/ldap" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">ldap</a></li><li class="field-item even"><a href="/category/tags/authentication" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">authentication</a></li></ul></section> Sun, 28 Mar 2010 17:18:58 +0000 Allan Feid 63 at https://allanfeid.com Kernel Virtual Machines using libvirt https://allanfeid.com/content/kernel-virtual-machines-using-libvirt <div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I use iSCSI from <a href="http://beta.allanfeid.com/content/ultimate-file-server-opensolaris-and-zfs" title="OpenSolaris File Server">a giant ZFS storage pool</a> in order to setup virtual machines. There's a couple advantages to this, as you get the power of ZFS snapshots and the ability to grow your virtual machine's disks fairly easily. To make administrating things a bit easier, I use one large iSCSI target and put LVM on top of this. So really this article will apply to anyone that wants to use logical volumes for their disks, which is much preferred over using files.</p> <p>I run my servers all in a headless manner, so I will be using <code class="prettyprint">virsh</code> and <code class="prettyprint">virt-install</code> over <code class="prettyprint">virt-manager</code>. Also, I will be using Fedora 12 for the virtual host as this is where KVM is actively developed and generally where you will find the best performance / stability.</p> <h2>Installing the required software</h2> <p>Fedora has a nice "Virtualization" group package which will get you setup to run KVM based virtual machines.</p> <pre> # yum groupinstall "Virtualization" -y # chkconfig libvirt on </pre><p>Since I want my virtual machines to have direct access to the network, I will put one of my NICs into a bridge. You will want to do the same unless you prefer the default NAT'd mode.</p> <h2>Network configuration</h2> <p>To configure your network you need to create <code class="prettyprint">/etc/sysconfig/network-scripts/ifcfg-br0</code> for a bridged interface. Use the following as an example:</p> <pre> # cat ifcfg-br0 DEVICE=br0 TYPE=Bridge BOOTPROTO=static IPADDR=10.10.0.3 NETMASK=255.255.0.0 ONBOOT=YES </pre><p>Then same directory, you need to edit the file for the interface you want attached to the bridge. For my configuration I'm using eth3.</p> <pre> # cat ifcfg-eth3 DEVICE=eth3 HWADDR=00:15:17:D6:35:69 ONBOOT=YES TYPE=Ethernet IPV6INIT=no USERCTL=no BRIDGE=br0 </pre><p>That's it. I highly recommend <strong>removing</strong> <code class="prettyprint">NetworkManager</code>. Don't just disable it, it's a waste of space and complicates things.</p> <pre> # yum remove -y NetworkManager # chkconfig network on # service network restart # ifconfig br0 br0 Link encap:Ethernet HWaddr 00:15:17:D6:35:69 inet addr:10.10.0.3 Bcast:10.10.255.255 Mask:255.255.0.0 inet6 addr: fe80::215:17ff:fed6:3569/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:68994 errors:0 dropped:0 overruns:0 frame:0 TX packets:25910 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:59178792 (56.4 MiB) TX bytes:1746255 (1.6 MiB) </pre><p>Now you have <code class="prettyprint">br0</code> to put virtual NICs (those created by KVM) on and access your network directly.</p> <h2>Disk configuration</h2> <p>Since LVM is useful in this situation, we're going to use it. I'm starting with a freshly partitioned disk so I will go over creating a proper LVM configuration. You need to know which partition and disk you will be creating this on, so if you don't know, do not just blindly run these commands. Consult with <code class="prettyprint">fdisk -l</code> and the man pages.</p> <pre> # fdisk -l /dev/sdc Disk /dev/sdc: 214.7 GB, 214748364800 bytes 255 heads, 63 sectors/track, 26108 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xae668fde Device Boot Start End Blocks Id System /dev/sdc1 1 26108 209712478+ 8e Linux LVM # pvcreate /dev/sdc1 # vgcreate zfs_lun /dev/sdc1 # lvcreate -L 20G zfs_lun -n guest1 # lvdisplay /dev/zfs_lun/guest1 /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error --- Logical volume --- LV Name /dev/zfs_lun/guest1 VG Name zfs_target LV UUID pVt1tv-OZSr-3joc-xaO1-iklH-z2eS-FEAbRf LV Write Access read/write LV Status available # open 1 LV Size 20.00 GB Current LE 5120 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:2 </pre><p>You now have a logical volume of 20GB that you can use for installing virtual machines. To briefly go over the commands above, first we needed to create the physical volume on top of <code class="prettyprint">/dev/sdc1</code>. From there you create a volume group, which is a collection of logical volumes. You can have more than one of these on a disk, but for my purposes I just let the volume group consume the entire physical volume. Finally, we setup a logical volume with 20GB of space. The last line is useful for double checking your work, which is always a good idea.</p> <h2>libvirt Configuration</h2> <p>Since I'm on an isolated trusted network, I like to have full access to the VNC serial connections made available. By default these only listen on localhost, and ssh port forwarding becomes tedious when you are trying to manage more than one at a time. So to open up VNC to the world, you need to uncomment this line in <code class="prettyprint">/etc/libvirt/qemu.conf</code>:</p> <pre> # VNC is configured to listen on 127.0.0.1 by default. # To make it listen on all public interfaces, uncomment # this next option. # # NB, strong recommendation to enable TLS + x509 certificate # verification when allowing public access # vnc_listen = "0.0.0.0" </pre><p>Restart libvirt after, also we'll make sure it starts on boot at this time:</p> <pre> # service libvirtd restart # chkconfig libvirtd on </pre><h2>virt-install, it's easy!</h2> <p>This command line utility is great. I strongly recommend reading the man page for this one as you will find useful information for installing guests the way you would like. I find it much more powerful than <code class="prettyprint">virt-manager</code>, as last I checked <code class="prettyprint">virt-manager</code> leaves out a few useful features from the libvirt library. (<cite>Disclaimer: I haven't used virt-manager in a long long time, at least in development years</cite>)</p> <pre> # virt-install --name guest1 \ --ram 1024 \ --location http://mirror.crazy.lan/Fedora/12/Fedora/x86_64/os \ --file /dev/zfs_lun/guest1 \ --vnc \ --bridge=br0 </pre><p>The long names of each option should make this fairly easy to understand. Location refers to the location of your installation media. This can be a variety of options (check the man page!) but http is my personal choice. File of course specifies the disk that you will be using, vnc tells <code class="prettyprint">qemu-kvm</code> to allow VNC access, and bridge specifies the network bridge to attach to.</p> <p>An interesting option that I once played around with was <code class="prettyprint">--pxe</code>. This allows your VM to boot over the network and install from there. This is a great little option if you've already got the infrastructure in place for netbooting, and possibly well worth setting up if you're tired of carrying around install CDs.</p> <h2>virsh</h2> <p>Your virtual shell. This is where you can modify your VMs and again, well worth looking at the man page for. If you're too lazy, just type <code class="prettyprint">virsh help</code> and you'll be presented with a list of options. So earlier we started an install, how can we check if it's running and connect to the serial console?</p> <pre> # virsh Welcome to virsh, the virtualization interactive terminal. Type: 'help' for help with commands 'quit' to quit virsh # list Id Name State ---------------------------------- 1 guest1 running virsh # vncdisplay guest1 :0 </pre><p>This tells you what VMs are running and the state they are in. The <code class="prettyprint">vncdisplay</code> command lets you find out which display to connect to when using vnc. So from your management station you can run the following to get in:</p> <pre>vncviewer virt02.crazy.lan:0</pre><p>Now you have a VNC window open and you will be taken through a normal installation process. That's it. There's a ton of things you can do with libvirt and really it just requires some reading. At some point I may consider looking more into <code class="prettyprint">virt-manager</code>, but honestly it leaves some to be desired compared to the already powerful command line tools.</p> </div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags:&nbsp;</h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Linux</a></li><li class="field-item odd"><a href="/category/tags/sysadmin" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">sysadmin</a></li><li class="field-item even"><a href="/category/tags/kvm" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">KVM</a></li><li class="field-item odd"><a href="/category/tags/libvirt" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">libvirt</a></li><li class="field-item even"><a href="/category/tags/virtualization" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">virtualization</a></li></ul></section> Mon, 01 Mar 2010 19:45:04 +0000 Allan Feid 59 at https://allanfeid.com Connect to iSCSI targets on Linux https://allanfeid.com/content/connect-iscsi-targets-linux <div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I'm going to be describing this process using Fedora, but any Linux that is using iscsiadm should use the same sort of configurations. To start off make sure you have the proper packages installed.</p> <!--break--><pre># yum install -y iscsi-initiator-utils </pre><p> Now you can easily see what iscsi targets are available on your portal (server):</p> <pre> # iscsiadm -m discovery -t st -p 10.20.0.2 10.20.0.2:3260,1 iqn.1986-03.com.sun:02:bf1479ba-a71d-c9d7-ab45-d51a1dca3416 # iscsiadm -m node -l Logging in to [iface: default, target: iqn.1986-03.com.sun:02:bf1479ba-a71d-c9d7-ab45-d51a1dca3416, portal: 10.20.0.2,3260] Login to [iface: default, target: iqn.1986-03.com.sun:02:bf1479ba-a71d-c9d7-ab45-d51a1dca3416, portal: 10.20.0.2,3260]: successful </pre><p> The first command will search for all targets available, the second will then login (-l) to all the found targets. If you only need to login to a specific target you can use the following: </p> <pre> # iscsiadm -m node --target "iqn.1986-03.com.sun:02:bf1479ba-a71d-c9d7-ab45-d51a1dca3416" --portal "10.20.0.2:3260" -l Logging in to [iface: default, target: iqn.1986-03.com.sun:02:bf1479ba-a71d-c9d7-ab45-d51a1dca3416, portal: 10.20.0.2,3260] Login to [iface: default, target: iqn.1986-03.com.sun:02:bf1479ba-a71d-c9d7-ab45-d51a1dca3416, portal: 10.20.0.2,3260]: successful </pre><p> Once you have logged in to your target(s) you'll see them as a disk if you run <code>fdisk -l</code>:</p> <pre> # fdisk -l Disk /dev/sdc: 214.7 GB, 214748364800 bytes 255 heads, 63 sectors/track, 26108 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xae668fde Device Boot Start End Blocks Id System /dev/sdc1 1 26108 209712478+ 8e Linux LVM </pre><p> I've already partitioned my target with <code>fdisk</code> but you may want to do the same. My primary use for iSCSI is to serve up a single large volume (zvol) and then I use LVM to give me volumes to use with my virtual machines.</p> </div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags:&nbsp;</h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Linux</a></li><li class="field-item odd"><a href="/category/tags/sysadmin" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">sysadmin</a></li><li class="field-item even"><a href="/category/tags/iscsi" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">iscsi</a></li><li class="field-item odd"><a href="/category/tags/fedora" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Fedora</a></li></ul></section> Mon, 01 Mar 2010 18:59:56 +0000 Allan Feid 58 at https://allanfeid.com Creating a Chroot Jail for SSH Access https://allanfeid.com/content/creating-chroot-jail-ssh-access <div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><strong>Update 5/30/2018</strong>: <blockquote><a href="https://twitter.com/CodingFree">@CodingFree</a> points out that the <code>l2chroot</code> script used in this blog post fails to handle <code>/lib64</code>, and <a href="https://twitter.com/el_shoo">@el_shoo</a> confirms everything in this post still works as long as you create <code>/lib64</code>. I have updated the post to reflect this, great to see it still working almost 10 years later.</blockquote> I wanted to setup a way to allow SSH access to my machine but limit their abilities heavily. To do that I figured a chroot jail was the best way. In this example I'm using ArchLinux and OpenSSH 5.1p1. It should be a very similar process on any *nix operating system. <h2>Setup your test user</h2> The way I'm setting this up, is that all my chrooted users will be added to the sshusers group. So we must setup the group, then add the user. <pre> $ groupadd sshusers $ adduser -g sshusers user </pre> <h2>Setup the jail directories</h2> The next step is to setup all the directories needed. This needs to emulate the / directory to a bare minimum. That is we need a dev, etc, lib, usr, and bin directory as well as usr/bin/. The base directory has to be owned by root. <pre> $ mkdir -p /var/jail/{dev,etc,lib,lib64,usr,bin} $ mkdir -p /var/jail/usr/bin $ chown root.root /var/jail </pre> You also need the /dev/null file: <pre>$ mknod -m 666 /var/jail/dev/null c 1 3</pre> You need to fill up the etc directory with a few minimum files: <pre> $ cd /var/jail/etc $ cp /etc/ld.so.cache . $ cp /etc/ld.so.conf . $ cp /etc/nsswitch.conf . $ cp /etc/hosts . </pre> Once this is done you need to figure out what commands you want accessible by your limited users. In this example I only want the users to be able to get into bash and use the ls command. So you must copy the binaries to the jail. <pre> $ cd /var/jail/usr/bin $ cp /usr/bin/ls . $ cp /usr/bin/bash . </pre> Now that you've got all the binaries in place, you need to add the proper shared libraries. To find out what libraries are need you can run ldd /path/to/bin. The output looks similar to this: <pre> $ ldd /bin/ls linux-gate.so.1 => (0xb7f2b000) librt.so.1 => /lib/librt.so.1 (0xb7f1d000) libacl.so.1 => /lib/libacl.so.1 (0xb7f16000) libc.so.6 => /lib/libc.so.6 (0xb7dcf000) libpthread.so.0 => /lib/libpthread.so.0 (0xb7db7000) /lib/ld-linux.so.2 (0xb7f2c000) libattr.so.1 => /lib/libattr.so.1 (0xb7db2000) </pre> Then you have to manually copy each file to the lib directory in your jail. That is a pain. Especially if there is a lot of shared libraries for a binary you want. I came across a useful script called <a href="http://www.cyberciti.biz/files/lighttpd/l2chroot.txt" title="A bash script from nixCraft">l2chroot</a> which automatically finds the libraries and copies them to your chroot jail. <pre> cd /sbin wget -O l2chroot http://www.cyberciti.biz/files/lighttpd/l2chroot.txt chmod +x l2chroot </pre> Edit the l2chroot file and change <cite>BASE=”/webroot” to BASE=”/var/jail”</cite>. This tells l2chroot where your jail is located so it copies everything to the right place. Now go ahead and run the command on the binaries you want. <pre> l2chroot ls l2chroot bash </pre> <h2>Configure SSHd to Chroot your users</h2> All that is left is to set a few things in your sshd configuration file. You need to make sure you have at least OpenSSH 4.8p1, because before that they didn't have this nice ChrootDirectory() function. Previously there was a few extra steps you had to take to get it working, but really you should have a newer version anyway. To configure ChrootDirectory add the following to /etc/ssh/sshd_config: <pre> Match group sshusers ChrootDirectory /var/jail/ X11Forwarding no AllowTcpForwarding no </pre> Note that this also disables X11Forwarding and does not allow port forwarding. If you want to setup a box to allow secure tunneling for your friends, you may want to change this. <h2>Optional Steps</h2> When you login to your test user, you'll notice a prompt as such: <pre>bash-3-2$</pre> That is not a very useful bash prompt. So if you want something a little better I recommend simply copying the contents of /etc/skel to /var/jail/home/user. This gives you a .bashrc file which sets the PS1 variable to a much nicer looking prompt. Here's what mine looks like: <pre> phrygian:~> echo $PS1 \h:\w> phrygian:~> </pre></div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags:&nbsp;</h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Linux</a></li><li class="field-item odd"><a href="/projects" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">project</a></li><li class="field-item even"><a href="/category/tags/ssh" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">ssh</a></li><li class="field-item odd"><a href="/category/tags/chroot" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">chroot</a></li><li class="field-item even"><a href="/category/tags/jail" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">jail</a></li></ul></section> Wed, 01 Apr 2009 03:57:00 +0000 Allan Feid 39 at https://allanfeid.com Securing LAMP: Apache https://allanfeid.com/content/securing-lamp-apache <div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I've decided to start a little mini-series here on how to secure a LAMP environment. For those that don't know this is a Linux + Apache + MySQL + PHP environment. This week I'll look at Apache specifically and continue with the other parts of this environment early next month. Click the link below to check it out.</p> <p><a href="/content/hardening-apache-server" title="Hardening an Apache Server">Hardening an Apache Server</a></p> </div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags:&nbsp;</h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Linux</a></li><li class="field-item odd"><a href="/category/tags/apache" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Apache</a></li><li class="field-item even"><a href="/category/tags/lamp" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">LAMP</a></li><li class="field-item odd"><a href="/category/tags/server" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">server</a></li></ul></section> Fri, 30 Jan 2009 02:25:49 +0000 Allan Feid 30 at https://allanfeid.com Hardening an Apache Server https://allanfeid.com/content/hardening-apache-server <div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Apache is a very popular web server for a Linux environment. Just as most services visible on the Internet, you should implement ways of protecting yourself from malicious users. Here I discuss how I harden my Apache installations as installed through the apt-get package management system on Debian (should be the same on Ubuntu as well). This should easily be applied to other distributions but just note that the locations of files are probably different. </p> <h2>1: Disabling unnecessary modules</h2> <p>When you install apache through apt-get on a Debian based server, it comes with a few modules pre-enabled that give an attacker too much information about your system. These are the <cite>autoindex</cite> and <cite>status</cite> modules. Here's what they do:</p> <ul> <li><em>autoindex:</em> provides a nice list of all the files in a directory where no index file is given</li> <li><em>status:</em> gives you a nice little server monitoring web page to visit</li> </ul> <p>There's more than one way to disable these modules. You can either remove the symlink from <cite>/etc/apache/mods-enabled/</cite> or use a built in command that does the exact same thing.</p> <pre> a2dismod status a2dismod autoindex </pre> <h2>2: Change some of the default settings</h2> <p>By default, most applications give you settings that let them just work. To secure things up you usually have to edit those config files. Well, apache is no different. Open up /etc/apache2/apache2.conf and change the following:</p> <cite>TIP: use the find function of your editor to quickly find these options</cite> <ul> <li>ServerSignature Off <ul><li>Stops your error pages from showing your Apache version number</li></ul></li> <li>ServerTokens Prod <ul><li>Stops HTTP header information from including Apache version information</li></ul></li> <li>Remove or comment out entire <code><? echo htmlspecialchars("<IfModule mod_autoindex.c> ... </IfModule>"); ?></code> section <ul><li>You already disabled this module, no need to have it here</li></ul></li> <li>Remove the Alias /icons/ line along with the directory listing below <ul><li>These icons are only used by the autoindex module, no point in having these here</li></ul></li> </ul> <h2>3: Add some custom configurations</h2> <p>Add these to <cite>/etc/apache2/httpd.conf</cite>. I'll explain what they do in the comments above each line.</p> <pre> <? echo htmlspecialchars("<Directory /var/www>"); ?> # This is used to prevent the TRACE http method from # gathering path information from proxy or cache servers <? echo htmlspecialchars("<LimitExcept GET POST>"); ?> deny from all <? echo htmlspecialchars("</LimitExcept>") ?> # The '-' disables the following options # FollowSymLinks - could allow an attacker to browse # outise the doc tree # # Includes - deals with .shtml; prevents server-side includes # # AllowOverride None - prevents developers from changing # options with .htaccess files other places in the doc tree Options -FollowSymLinks -Includes -Indexes -MultiViews AllowOverride None Order allow,deny Allow from all <? echo htmlspecialchars("</Directory>"); ?> </pre> <p>Also, add this to the same file to prevent access to your root directory (/):</p> <pre> <? echo htmlspecialchars("<Directory />"); ?> Order deny,allow deny from all <? echo htmlspecialchars("</Directory>"); ?> </pre> <h2>4: Change some file permissions</h2> <p>Your public html folder (in Debian by default this is <cite>/var/www</cite>) should be only writable by root. It does still need to be world readable however so apply the following permissions:</p> <pre> chown -R root /var/www chmod -R 775 /var/www </pre> <h2>Summary</h2> <p>This will give you a pretty secure Apache server, but it's by no means complete and depends entirely on what you need to do on your server. This is just a list of my own personal recommendations and is what I use to setup a web server from scratch. The key to staying secure, however, is to keep your systems up-to-date and watch bug tracking mailing lists (Bugtraq for example) for any reports as they often supply workarounds and fixes for these issues.</p></div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags:&nbsp;</h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Linux</a></li><li class="field-item odd"><a href="/projects" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">project</a></li><li class="field-item even"><a href="/category/tags/debian" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Debian</a></li><li class="field-item odd"><a href="/category/tags/apache" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Apache</a></li></ul></section> Fri, 30 Jan 2009 02:18:46 +0000 Allan Feid 29 at https://allanfeid.com Installing an Atheros Based Wireless Card on the Eee 901 https://allanfeid.com/content/installing-atheros-based-wireless-card-eee-901 <div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><p>So, I got pretty fed up with the Ralink RA2860 wireless card that comes with my ASUS Eee 901. It does not play well with <a href="http://www.remote-exploit.org/backtrack.html" title="Backtrack">Backtrack 3</a> nor does it do packet injection. I want to turn this thing into a nice little security machine that I can bring with me and easily start testing some networks. In order to do that I got a new <a href="http://www.oxfordtec.com/us/MiniPCI-EXPRESS-Wireless/c42/p149/GIGABYTE-GN-WS50G--802.11-b/g-Atheros-AR5007-chipset-minicard-mPCI-express-card/product_info.html" title="Gigabyte GN-WS50G">Atheros based card from Gigabyte</a>. This card is known to work well with Backtrack and of course is highly supported in the Linux world. For those that care, it is an Atheros AR5007 chipset.</p> <p>Once I got the part in the mail I opened it up to install:</p> <p><center><br /> <img src="/sites/default/files/tmb_eee_open.JPG" alt="Opening the Eee PC and removing the MiniPCI Express wireless card" /></center></p> <p>Very simple to open, all you have to do is remove two screws and take off the plate. To remove the wireless card, take off the two pigtail connectors, which I have circled in red, then remove the two screws circled in blue. Finally move the two pigtail wires and you should see the card pop itself up.</p> <p><center><br /> <img src="/sites/default/files/tmb_eee_card_compare.JPG" alt="Ralink RA2860 and Gigabyte GN-WS50G side by side" /></center></p> <p>Remove the MiniPCI Express card and insert your new wireless card. Then screw it back in and pop on the pigtail connectors. You are now good to go. If you're using Windows I'll assume you have to install the drivers included but on Ubuntu and Backtrack my card was recognized instantly.</p> <p><center><br /> <img src="/sites/default/files/tmb_eee_new_card.JPG" alt="New Gigabyte GN-WS50G Atheros AR5007 based card in my Eee 901" /></center></p> <p>Enjoy your new Atheros based wifi card!</p> </div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags:&nbsp;</h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Linux</a></li><li class="field-item odd"><a href="/category/tags/eee" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">eee</a></li><li class="field-item even"><a href="/category/tags/wireless" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">wireless</a></li><li class="field-item odd"><a href="/category/tags/atheros" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">atheros</a></li><li class="field-item even"><a href="/category/tags/ra2860" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">ra2860</a></li><li class="field-item odd"><a href="/category/tags/backtrack" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Backtrack</a></li></ul></section> Thu, 25 Dec 2008 17:28:14 +0000 Allan Feid 26 at https://allanfeid.com Pandora Desktop on Adobe AIR https://allanfeid.com/content/pandora-desktop-adobe-air <div class="field field-name-body field-type-text-with-summary field-label-hidden view-mode-rss"><div class="field-items"><div class="field-item even" property="content:encoded"><p>So today <a href="http://www.adobe.com/products/air/" title="Adobe AIR">Adobe AIR</a> came out of beta for Linux. That is great news because I also came across the <a href="http://www.pandora.com/desktop" title="Pandora Desktop">Pandora Desktop</a> (currently in beta) in the same day. These two complement each other very well. It is great for removing that one Firefox window or tab that I always have open to <a href="http://www.pandora.com" title="Pandora Internet Radio">Pandora</a>.</p> <p>Take a look at Pandora Desktop in action:</p> <p><center><br /> <img src="/sites/default/files/pandora_open.png" /></center></p> <p>And here you can see the slick menu accessible from a nice icon in your tray:</p> <p><center><br /> <img src="/sites/default/files/pandora_menu.png" /></center></p> <p>Being that this is a beta it is still very useful and I highly recommend you give it a try. The only problem I had was getting the full view Pandora open every now and then. That's not really needed though since you can do pretty much everything through the menu on the icon.</p> </div></div></div><section class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above view-mode-rss"><h2 class="field-label">Tags:&nbsp;</h2><ul class="field-items"><li class="field-item even"><a href="/category/tags/ubuntu" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Ubuntu</a></li><li class="field-item odd"><a href="/category/tags/linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Linux</a></li><li class="field-item even"><a href="/category/tags/pandora" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Pandora</a></li><li class="field-item odd"><a href="/category/tags/adobe-air" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">Adobe AIR</a></li></ul></section> Thu, 18 Dec 2008 19:54:41 +0000 Allan Feid 25 at https://allanfeid.com