#!/bin/sh

# uncomment it for debugging
#set -x

# ssh config
mkdir -p ~/.ssh
src="/vagrant/files"
# ssh without password
cat ${src}/id_rsa.pub | awk '{print $1, $2, "Generated by vagrant"}' >> ~/.ssh/authorized_keys2
cat ${src}/id_rsa.pub | awk '{print $1, $2, "Generated by vagrant"}' >> ~/.ssh/authorized_keys
cp ${src}/id_rsa* ~/.ssh/

cat >> ~/.ssh/config << EOF
Host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
EOF
chmod 600 ~/.ssh/*
