Skip to content

Instantly share code, notes, and snippets.

@jlongman
Created May 25, 2015 14:31
Show Gist options
  • Save jlongman/3cd87d7952f79892b26c to your computer and use it in GitHub Desktop.
Save jlongman/3cd87d7952f79892b26c to your computer and use it in GitHub Desktop.
publish ssh key to host
# there's a tool on Linux that does similar to this, not on FreeBSD
ssh_publish(){
host=$1
shift
ssh-keygen -R $host
cat ~/.ssh/id_dsa.pub | ssh -oStrictHostKeyChecking=no $host $@ "mkdir -p .ssh && cat >> .ssh/authorized_keys"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment