RSS feed

Debian reset root password

In order to reset the password, you need to boot your debian installation into single user mode. You can do this by following the steps below;

1. Once grub menu comes up, select the single user entry and press ‘e’
2. Select the kernel … line and press ‘e’ once again
3. Append ‘init=/bin/bash’ at the end of line and press b to boot

You will be dropped into a shell, next you need to mount the filesystem in read/write mode in order to change the password.

5. mount -n -o remount,rw /
6. passwd
7. reboot

That’s all there is to it!



Adding startup script to run levels

Place the startup script in /etc/init.d/ then use update-rc.d to make it start on bootup with the following;

update-rc.d myscript defaults

The option “defaults” puts a symlink to start myscript on run levels 2, 3, 4 and 5 and a symlink in 0, 1 and 6 to stop myscript on shutdown/reboot.



warning: SASL authentication failure: cannot connect to saslauthd server: Permission denied

Check the OPTIONS directive in /etc/default/saslauthd and set it to within your postfix chroot.

OPTIONS=”-c -r -m /var/spool/postfix/var/run/saslauthd”

Then run;

dpkg-statoverride –add root sasl 710 /var/spool/postfix/var/run/saslauthd

adduser postfix sasl

Restart both postfix and saslauthd for the changes to take effect.



Debian xenserver updates apt repository missing GPG key

After you’ve installed XenTools on your VM and you try to do a apt-get update you are greeted with a GPG error message saying that the repository isn’t trusted. This is because the GPG key Citrix use to sign their packages has not been added to the apt keyring.

To fix it, run;

wget -q http://updates.vmd.citrix.com/XenServer/5.5.0/GPG-KEY -O- | apt-key add —



apt-get update GPG error

W: GPG error: http://ftp.uk.debian.org etch Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 9AA38DCD55BE302B
W: There is no public key available for the following key IDs:
9AA38DCD55BE302B
W: You may want to run apt-get update to correct these problems

 

Solution:

 

# gpg –recv-keys 9AA38DCD55BE302B
# gpg –export 9AA38DCD55BE302B | apt-key add —

 

OR

 

# apt-get install debian-keyring debian-archive-keyring
# apt-key update



Counting up to the UNIX Epoch time reading 1,234,567,890!

Unix time, or POSIX time, is a system for describing points in time, defined as the number of seconds elapsed since midnight Coordinated Universal Time (UTC) of January 1, 1970, not counting leap seconds. It is widely used not only on Unix-like operating systems but also in many other computing systems. It is neither a linear representation of time nor a true representation of UTC (though it is frequently mistaken for both) as the times it represents are UTC but it has no way of representing UTC leap seconds (e.g. 1998-12-31 23:59:60).

“At 11:31:30pm UTC on Feb 13, 2009, Unix time will reach 1,234,567,890.

Where will you be at this momentous second?” – from Bell Labs

You can use the following perl command to find out when the Epoch time reading will be 123456789 in your time zone

perl -e 'print scalar localtime(1234567890),"\n";'


PTY allocation request failed on channel 0

After creating a new VM on Debian Lenny, I got the following when trying to ssh into the DomU;

PTY allocation request failed on channel 0
stdin: is not a tty

Run the following to fix the issue;

apt-get install udev



Policyd Build Error

policyd error Your OS doesnt support MSG_NOSIGNAL or SO_NOSIGPIPE

apt-get install g++ gcc

policyd.h:52:19: error: mysql.h: No such file or directory

apt-get install libmysqlclient15-dev


Xen on Debian Etch

I’ve been testing out a few virtualization systems and am sofar very pleased with Xen. Installing on Debian Etch couldn’t be easier and it worked straight out the box – I had my first virtual server running in under 15 minutes flat!

Use the following commands to install Xen on a Debian Etch machine:

apt-get install xen-linux-system-2.6.18-4-xen-686 libc6-xen bridge-utils

This will install the Xen kernel (2.6.18-5-xen-686 #1 SMP), the libc6-xen libraries which is optimized for the Xen hypervisor and the utilities for configuring the Linux ethernet bridge.

Next up is a reboot into your newly installed kernel:

reboot

Once the machine is back online you need to install the xen-tools package which allows you easily create new guest Xen domains on your Debian Etch host:

apt-get install xen-tools

Next, modify the Xen config file (/etc/xen/xend-config.sxp) and enable:

(network-script network-bridge)

You also need to modify /etc/xen-tools/xen-tools.conf to set kernel and initrd parameters as well as the disk and sizing options for your vistual servers.

You can easily find out what your kernel and initrd image is named by typing:

ls /boot/vmlinuz* /boot/initrd*

This will list the kernel and initrd names for your system. Remember, your after the xen kernel and initrd images!

/boot/initrd.img-2.6.18-5-xen-686

/boot/vmlinuz-2.6.18-5-xen-686

Continue and edit the xen-tools configuration file

vi /etc/xen-tools/xen-tools.conf

#
# Default kernel and ramdisk to use for the virtual servers
#
kernel = /boot/vmlinuz-2.6.18-5-xen-686
initrd = /boot/initrd.img-2.6.18-5-xen-686

dir = /data/vservers
debootstrap = 1
gateway   = 172.16.0.1
netmask   = 255.255.255.0

size   = 6Gb
memory = 256Mb
swap   = 256Mb
fs     = ext3
dist   = etch
image  = sparse

Next, create the directory where your virtual servers will reside:

mkdir -p /data/vservers/domains

Now your ready to create your first virtual server! Use the following command to create it:

xen-create-image -hostname=dns -ip=172.16.0.25 -passwd

It will take a minute or two to create the virtual server after which you can fire it up by using:

xm create dns.cfg

Your virtual server should be started up and ready for you to use.. You can either ssh to the IP you created the server with or attach to it from the host using:

xm console dns

Have fun with your Xen virtual machine!




Categories