Posts Tagged ‘ubuntu’

Ubuntu: change default encryption algorithm

Sunday, July 12th, 2009

While fighting with DB2 denying logins I had to change the default hash algorithm used to store passwords in /etc/shadow.

As far as I know (and as grep -i -r "sha512" /etc/* tells me :-) ), there are two files that carry this information. Namely /etc/pam.d/common-password and /etc/login.defs.

To change the algorithm from sha512 (which shifts as the default in the new Ubuntu releases) change this:

/etc/pam.d/common-password

password [success=1 default=ignore] pam_unix.so obscure sha512

to

password [success=1 default=ignore] pam_unix.so obscure md5

/etc/login.defs

ENCRYPT_METHOD SHA512

to

ENCRYPT_METHOD MD5

HOWTO: add disk to VMware Ubuntu guest without reboot using LVM

Friday, July 10th, 2009

This howto is mostly built on the great tutorial available at http://www.comnetslash.com/…hout-reboot/. My spot tries to be more Ubuntu and LVM specific. This manual was tested on Ubuntu 9.04 (jaunty) Server edition guest OS.

Add Virtual Hard Disk

add-disk1 A new hard disk can be added easily to a running virtual machine in VMWare Infrastructure Web Access by clicking Add Hardware and following the wizard.

Note: I assume that all of the commands given are run under superuser (root) rights. To become root type

sudo su root

Detect new SCSI Disk

The package scsitools provides the script rescan-scsi-bus.sh, which does exacly what we need. Install it and run it:

apt-get install scsitools
rescan-scsi-bus.sh

This should detect the newly added hard disk and make it available in /dev/ – /dev/sdb in the case you are adding a new drive for the first time. The output of fdisk -l should include the newly detected disk.

Format the new disk

Format the newly detected drive using fdisk

fdisk /dev/sdb
    n (for new partition)
    p (for primary partition)
    1 (partition number)
    (keep the other values default)
    w (write changes)

Change the type of the partition to LVM Linux:

fdisk /dev/sdb
    t (change the partition type)
    8e (for Linux LVM)
    w (write changes)

LVM

Initialize LVM Physical Volume

pvcreate /dev/sdb1

Add Physical Volume to Volume Group

List the Volume groups available at your machine.

vgdisplay

Replace VolGroupName with what you read from the output of the last command.

vgextend VolGroupName /dev/sdb1

You should see the newly aquired free space in the output of

vgdisplay

Resize Logical Volumes

After adding some free space to your Volume Group, you can distribute it to the Logical Volumes. The list of Logical Volumes can be obtained by running

lvdisplay

Run the following commands for each Logical Volume you want to resize (add space to). Again – replace /dev/VolGroupNa­me/Name with the Logical Volume name you can read from the output of the last command. The +10G means Add 10 GB

lvextend -L +10G /dev/VolGroupName/Name

The last step is to resize the ext3 filesystem (use different tool is you use different filesystem):

resize2fs /dev/VolGroupName/Name

Shibboleth Ubuntu

Tuesday, June 23rd, 2009

SP2 Installation

I switched one server from Fedora Core to Ubuntu yesterday. Shibboleth 2 SP installation is a bit more tricky under Ubuntu than Fedora Core. The packages are not available in the Ubuntu repositories, but Satya's blog serves a working howto.

failed to bind to socket

Shibboleth seemed to be working well after installation, but today it was down dumping

2009–06–23 12:51:53 ERROR Shibboleth.Listener : socket call resulted in error (2): no message 2009–06–23 12:51:53 CRIT Shibboleth.Listener : failed to bind to socket.

into the /var/log/shibboleth/shibd.log. I luckily found a solution in quite a short time. The problem was that the shibd was trying to create socket in /var/run/shibboleth directory, which did not exist. Creating it once does not help because Ubuntu removes content of /var/run/ at every reboot. To fix it this has to be added to /etc/init.d/shibd

if [ ! -e /var/run/shibboleth ]
then
   mkdir /var/run/shibboleth
fi