Archive for the ‘Fedora’ Category

SSH authentication with your public key

Saturday, May 3rd, 2008

I can see that you are lazy, and I know how hard it is to type an user name and password each time you want to login via SSH on a server.

Today, we are going to learn how to configure your computer and a server to allow automatic SSH authentications using your public RSA key. Less work = More fun!

Configuration on your computer:

As your normal user, open a terminal and type ssh-keygen

It will ask you some questions, you can simply press enter to acknowledge the default choices. You don’t need to enter a password here if you don’t want to be asked for it at each login on the server, it’s not a security flaw. The output should be something like that:

[Steven@HP6710 ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/Steven/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/Steven/.ssh/id_rsa.
Your public key has been saved in /home/Steven/.ssh/id_rsa.pub.

The important thing is that you have 2 new files in your user/.ssh directory.

  • id_rsa is your private key, you should NEVER give it away.
  • id_rsa.pub on the other side is your public key, the one that you can give away.

Configuration on the server:

As the user you wish to be logged in (let’s say root), also run the ssh-keygen command to create the /root/.ssh directory. Now go to your /root/.ssh directory and create a text file named authorized_keys2. Copy the content of your computer’s public key file (id_rsa.pub on HP6710) to this file and save it.

Job done, now you can run ssh root@server from your computer and it will log you in automagically :)

My first RPM

Tuesday, April 29th, 2008

As I said last week, I packaged the PHP MDB2 driver for PostgreSQL as an RPM for Fedora 8 and 9. Actually, this is my first self-made RPM ever and I’m quite happy with it.

I learned my way trough SPEC files and rpmbuild thanks to this excellent documentation on the wiki and of course by looking at other SPEC files...I love Open Source for that!

If I don’t detect any bugs, I’ll try to push this package in Fedora and become an active contributor :)

Ah, my homemade Hackergotchi was also accepted. I now have a face on the Planet. Yes, it’s scary.

Edit: someone already had the same idea :)

Updated kernel for the Fedora 8 Alpha port

Friday, April 25th, 2008

As announced by Jay Estabrook on the axp-list, there is a 2.6.24 kernel available for the Fedora 8 Alpha port (along with some other updates). You may not see these new files if you run a yum update because of yum’s cache, the directory structure on the update server has apparently been changed as far as I can tell. So simply run a yum clean all and voilĂ , you can install the new kernel.

Once it is installed, you need to tell aboot (the secondary boot loader for Linux/Alpha, we don’t have Grub) how to boot on the new kernel, edit you /etc/aboot.conf file and add a new configuration:

0:1/vmlinuz-2.6.24.4-64.2axp.fc8 initrd=/initrd-2.6.24.4-64.2axp.fc8.img
root=/dev/VolGroup00/LogVol00 selinux=off rhgb quiet
1:1/vmlinuz-2.6.23.10-97.fc8.1axp initrd=/initrd-2.6.23.10-97.fc8.1axp.img
root=/dev/VolGroup00/LogVol00 selinux=off rhgb quiet

The first number is an unique identifier used by the SRM. For example, you can boot on the 2.6.23 kernel with boot dka0 -fl “1″ and on the 2.6.24 kernel with boot dka0 -fl “0″ (if your disk is recognized as DKA0 by the SRM). The second number represents the partition the kernel resides on, BSD-style. man aboot.conf is your friend if you are lost!

PHP, Pear MDB2 and PostgreSQL

Wednesday, April 23rd, 2008

Did you ever wonder how to write portable PHP code that works on MySQL, PostgreSQL, Oracle, MSSQL or SQLite? Then what you need is the Pear MDB2 package. It’s an abstraction layer between your PHP code and the database. It’s really not hard to learn and use! Of course, you have to use “standard” SQL queries that are common to all databases in your PHP code :)

In Fedora 8/9, you can install the MDB2 package with yum install php-pear-MDB2. This is the base package, now you need to install a driver for your database. To access MySQL it’s yum install php-pear-Driver-mysqli.

Note that on the screenshot above (PackageKit in F9), there are only 2 MySQL drivers available as RPM’s in Fedora. This little choice defeats the purpose of the abstraction layer, so I’m probably going to create driver packages for the other databases (or at least PostgreSQL) next week and try to push them into Fedora.

Writing from the Alpha running Fedora 8

Saturday, April 19th, 2008

The screenshot says it all: the Fedora 8 port to the Alpha architecture works fine :) My old EV56 533MHz is happier than ever! The distribution was installed in 32 minutes, and around 50 updates were available via yum directly after the install. All my hardware works, you can see it on my smolt profile.

Alphas ROCK!

Fedora 9 Preview

Friday, April 18th, 2008

The Fedora 9 Preview ISO’s are available! If you want to help Fedora, try it and report bugs...the final version should come out around mid-May as you can see on the schedule page. Remember that this build is only meant for testing purpose, not for a stable workstation.

Fedora 8 based distribution for the Alpha architecture

Monday, April 14th, 2008

Today, there was good news on the Linux AXP mailing list: the Fedora 8-based Linux distribution is alive! This is time to reinstall my Alpha EV56 I guess, and playing with it is a lot of fun :)

Note that Gnome and Java is buggy, so you are strongly encouraged to use KDE.

Read the full announcement on RedHat’s AXP mailing list.

The Ubuntists, or why I chose Fedora

Tuesday, April 8th, 2008

Today, there was an interesting but controversial article in my RSS feed: Fedora is the new Ubuntu. You should read it before you continue. This is the perfect moment for me to talk about why I chose to use Fedora instead of the universally loved Ubuntu distribution...first of all, I want it to be clear: I tested Ubuntu 7 and 8 beta and I’m not a sectarian.

The first point that made me chose Fedora is what’s perfectly described in the linked article: Canonical doesn’t contribute to the whole Linux ecosystem enough. On the other side, Fedora/RedHat is a HUGE contributor (as is Novell/SuSE by the way).

The second point has more to do with human feelings...particularly arrogance. Since some time, a small group of people using Ubuntu started hating/flaming other Linux users if they don’t use their beloved distribution, and that’s really sad. You can clearly see it on forums (French formus at least). You are not helping your distribution, nor Linux in general by behaving this way!

A much more recent event just happened yesterday during a PHP lesson at school; I’m using Fedora as my development environment, and the teacher is using Ubuntu. He constantly came to me, to tell me how superior Ubuntu was, and that I should switch...blablabla. This form of zealotry really annoys me...Hey! We are all Linux user, so let me chose!

Don’t mess with libc (Fedora 8 to Fedora 9)

Tuesday, April 1st, 2008

Yesterday, I tried to upgrade my Fedora 8 test installation to Fedora 9 Beta using yum. The upgrade worked fine, after a 1.1GB download I could reboot, but only with the old Fedora 8 kernel. Fedora 9′s 2.6.25 kernel segfaulted right after the “uncompressing linux” message by displaying some libc.so errors.

So I felt smart, and thought that I could probably resolve this problem by installing F9′s glibc and glibc-common packages with yum.

I tried to uninstall them with an rpm -e glibc glibc-common, but these package had a lot of dependencies. Well, not a big deal...rpm -e glibc glibc-common --nodeps (remember, I felt smart).

Fatal error! NEVER try this at home kids! My system was obviously dead, I couldn’t even reinstall the new versions as yum relies on these packages :)

Fedora 9 Beta

Tuesday, March 25th, 2008

A simpe and short post to announce that the Beta of Fedora 9 is out, grab the ISO’s here and read the release notes here :)