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:
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:
Hopefully this helps if you run into a similar issue down the line!
I ran into an interesting issue today where we had a client migrating to us that needed us to allocated X IPs to each VPS on a node he had with us. X ranged from 1 IP to up to 12 per VE so I wrote a script that took three input files (one with available IPs [newips], one with VEIDs [veids], and one with the number of IPs each VEID was allocated [numips]) and doled out the IPs as needed. Here is the result:
for i in `cat veids`
numips=$(sed -n "$k"p numips)
for (( c=1; c<=$numips; c++ ))
ip=$(sed -n "$r"p newips)
echo "Add $ip to $i"
vzctl set $i --ipadd $ip --save
Hopefully this will help any others who run into a similar issue.
Have a great day!