I just got fed up with having to enter the password for ssh connections time and again. Of course, it's a simple matter of copying a few files and setting a few permissions, but I just can't remember the exact things to do. So here you go: just create a key with
ssh-keygen -t dsa
and run this script:
# rhive.sh - create remote hive (well, RSA authentication).
# $1 needs to be 'user@host'. Need to enter password two or three times.
echo 'Creating remote
ssh $1 'mkdir -p ~/.ssh && chmod 700 ~/.ssh'
if [ -f ~/.ssh/identity.pub ] ; then
echo 'Transferring identity.pub -> known_hosts...'
scp ~/.ssh/identity.pub $1:~/.ssh/known_hosts
if [ -f ~/.ssh/id_dsa.pub ] ; then
echo 'Transferring id_dsa.pub -> authorized_keys2...'
scp ~/.ssh/id_dsa.pub $1:~/.ssh/authorized_keys2
echo 'Setting permissions on public keys...'
ssh $1 'chmod 600 ~/.ssh/*'