OpenSSH won’t start

I ran into an issue with OpenSSH Server would not start after fresh installation of it on a minimal CentOS 5 x86_64 VPS:

[[email protected] ~]# /etc/init.d/sshd restart
Stopping sshd:                                             [FAILED]
Generating SSH1 RSA host key:                              [FAILED]

I delved a little further and discovered that ssh-keygen was failing:

[[email protected] ~]# ssh-keygen 
cannot read from /dev/urandom, No such file or directory

And finally, from there, I generated the urandom file:

/sbin/MAKEDEV urandom

Also, to ensure on restarts the urandom file (as well as pty and tty) are created, I added the following to /etc/rc.d/rc.local:

/sbin/MAKEDEV pty
/sbin/MAKEDEV tty
/sbin/MAKEDEV urandom

Hopefully this helps if you run into a similar issue down the line!

Install Xen 3.4.3 on CentOS 5.x

So I have had to install Xen 3.4.3 recently 3 different times so I thought I’d make a quick post regarding the best route I have found to do this. Please note, this may not be the most optimal route but it has worked well for me 3 times now:

yum install xen PyXML mesa-libGL
yum remove xen python-virtinst libvirt-python libvirt xen-libs
mkdir rpms
cd rpms
wget http://www.gitco.de/repo/xen3.4.3/libvirt-0.7.0-6.el5.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/libvirt-client-0.7.0-6.el5.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/libvirt-python-0.7.0-6.el5.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/python-virtinst-0.500.0-1.el5.noarch.rpm
wget http://www.gitco.de/repo/xen3.4.3/xen-3.4.3-1.el5.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/xen-libs-3.4.3-1.el5.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/glusterfs-client-2.0.8-1.el5.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/glusterfs-common-2.0.8-1.el5.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/fuse-2.7.4-1.rf.x86_64.rpm
wget http://www.gitco.de/repo/xen3.4.3/libibverbs-1.1-1.x86_64.rpm
rpm -ivh *.rpm

After that block, make sure you edit /etc/grub.conf to set the following lines:

---snip---
default = 0
---snip---
kernel /xen.gz-3.4.3 dom0_mem=512m
---snip---

The first will set the xen kernel as the default and the second will limit dom0 to only be able to use 512m of memory, leaving the rest for your VEs. After these changes, go ahead and reboot. Let me know if this route works for you!