Dominik Honnef

Ready for a change?

Yesterday, after facing more and more problems with my Debian installation on my VPS, I decided it was a good idea to try out something new, namely Gentoo on a server.

Well, to make a very long story short: After 6 hours of updating 60 packages and noticing how poor the I/O on the VPS is, I decided to give up and installed Debian again… Gentoo definitely shouldn’t be your choice when on an overcrowded VPS.

Oh, and since I am already writing a post, here is a script that is useful when setting up servers (and using public key auth):

#!/usr/bin/env sh
echo "Deploying public key on $1"
scp ~/.ssh/id_rsa.pub $1:
ssh $1 'mkdir ~/.ssh; chmod 700 ~/.ssh; cat ~/id_rsa.pub >> ~/.ssh/authorized_keys; chmod 600 ~/.ssh/authorized_keys; rm ~/id_rsa.pub'

In addition, as of 2009/10/07:

zenspider was so friendly to provide me with an even better way of deploying the public key, not requiring you to use scp which in turn means only one password prompt (it also does not need the use of chmod nor any temporary file):

#!/usr/bin/env sh
echo "Deploying public key on $1"
ssh $1 'umask 0077; mkdir -p ~/.ssh; cat >> ~/.ssh/authorized_keys' < ~/.ssh/id_dsa.pub