Skip to content

Instantly share code, notes, and snippets.

View miguelcnf's full-sized avatar

Miguel Fonseca miguelcnf

View GitHub Profile
$ cat /.ssh/config
Host *
ServerAliveInterval 60
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
Host nat*.eu1.dev.foo.bar.com
ProxyCommand none
IdentityFile /Users/foo/.ssh/id_dsa_bar
User ec2-user
# -*- mode: ruby -*-
# vi: set ft=ruby :
boxes = {
:tomcat => {
:ipaddress => "172.31.254.110",
:role => "application"
},
:mysql => {
:ipaddress => "172.31.254.120",
@miguelcnf
miguelcnf / ssh-deploy-key
Created September 23, 2013 00:49
Perl script to iterate through a list of hosts and deploy an ssh public key without having to enter the same user password each and every time.
#!/usr/bin/env perl
#
# Usage: ssh-deploy-key -h (--hostsfile) PATH_TO_HOSTS_FILE
# -p (--pubkeyfile) PATH_TO_PUBKEY_FILE
# [ -u (--user) USER ]
#
# Expects --hostsfile to contain 1 host per line
# Assumes current user if --user is not given
#