Linux fun

We had two bags of grass, seventy-five pellets of mescaline, five sheets of high powered blotter acid, a salt shaker half full of cocaine, and a whole galaxy of multi-colored uppers, downers, screamers, laughers… and also a quart of tequila, a quart of rum, a case of beer, a pint of raw ether and two dozen amyls. Not that we needed all this for the trip, but once you get locked in a serious drug collection, the tendency is to push it as far as you can.

Hunter Thompson, Fear and Loathing in Las Vegas

Installing linux distros is a bit like that. You want always want to push it a little further.

Not long ago I ditched Ubuntu and set off in search of a distro I liked better. I needed something fairly light weight since I run it on an old Dell PIII 500 I picked up a couple of years ago for $50. I mostly want an http server for my house, but also want to be able to netsurf as needed, with decent multimedia support.

I rejected Suse 10, and moved on to Fedora Core 5, as mentioned here. I like FC5, but the multimedia support is only so-so, and that thanks to Eric Raymond’s notes. Out of the box FC5 has no multimedia support. The various codecs required to play mpegs and the like are encumbered by license issues.

The Gnome desktop on FC5 is pretty and reasonably fast, but (to my taste) clumsy. Last night I decided to give Vector Linux a shot. I had read good things about it.

The install went fine, but it does require the user to create and format partitions. This might scare off some folks, but it’s really no big deal. More of a hassle was the fact that VL wanted to install the LILO bootloader, while Fedora had already installed the GRUB bootloader. I wanted to keep FC5, so I had to get one of the bootloaders to dual boot Fedora and VL. In theory this should not be a problem, that is what bootloaders are for. On the other hand, I had never actually configured such a setup. I decided to go with GRUB, and chose to skip installing LILO during the VL install.

When I rebooted, up came Fedora, with no hint of VL in sight. The trick to handling these situations is to have Google access, and a spare computer in case you hose the one you are working on. A bit of digging, and I found a solution. I want to document it here, in case it might help someone else.

So here is the layout. I have FC5 installed on the primary drive on partition hda2 and VL installed on the secondary drive on partition hdb2. The GRUB bootloader is configured by the file (on Fedora) /boot/grub/grub.conf. Here is the magic incantation:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,1)
# kernel /boot/vmlinuz-version ro root=/dev/hda2
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=0
timeout=15
splashimage=(hd0,1)/boot/grub/splash.xpm.gz
#hiddenmenu

title Fedora Core (2.6.16-1.2111_FC5)
root (hd0,1)
kernel /boot/vmlinuz-2.6.16-1.2111_FC5 ro root=LABEL=/1 rhgb quiet
initrd /boot/initrd-2.6.16-1.2111_FC5.img

title Fedora Core (2.6.16-1.2096_FC5)
root (hd0,1)
kernel /boot/vmlinuz-2.6.16-1.2096_FC5 ro root=LABEL=/1 rhgb quiet
initrd /boot/initrd-2.6.16-1.2096_FC5.img

title Vector Linux
root (hd1,1)
kernel /boot/vmlinuz root=/dev/hdb2 ro vga=791 video=vesafb:ypan
savedefault

The last four lines are what I added to enable GRUB to boot VL. There are only four lines in that stanza, if you see more, try reducing your font size or just view the page source. When copying code via a web browser, it is often a good idea to copy it from the page source, to avoid spurious wraps and possible character representation issues.

Also notice that I commented out hiddenmenu. This allows the boot menu to show the various choices during startup. I also increased the time till the startup menu defaults from 5 to 15 seconds. Finally, notice that linux partitions count from 1 (hda1, hda2,…) but GRUB counts from 0. Thus (hd0,1) means first drive, second partition, or hda2.

One thing I like to do after an install is set up ssh to use key based authentication, and then turn off password authentication. And there lies another tale. The sshd service is controlled by the /etc/ssh/sshd_config file. Here is the relevant portion of mine:

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
#PermitEmptyPasswords no

After making that change to no, saving the file, and restarting the sshd service, password authentication should not have worked. But it did.

Back to Google. Digging around on usenet turned up two similar cases, one on Ubuntu, one on OS X Tiger. Both claimed to have solved the problem by changing the default

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes

from yes to no. So far as I can tell from various ssh docs, this should have nothing to do with password authentication. I made the change, restarted sshd, and magically, password authentication was off at last.

How people got this stuff to work before Google is beyond me.

A final tip. If you are setting up a home webserver, chances are you also want MySQL, Perl, and PHP. Installing these separately and getting them to work with Apache can be a real pain. Don’t go that way. Instead get XAMPP. One very simple install and everything just works. XAMPP is not suitable for production webservers where security is paramount, but it rocks for personal use. Absolutely top notch.

Leave a Reply