Brad's Blog

Published: 2009-04-30

Push Your SSH Public keys using Fabric

Python fabric

This came across my twitter radar today from @bitprophet (aka: Jeff Forcier), who just happens to be the new maintainer for Fabric:def push_key(): keyfile = '/tmp/' % env.user run('mkdir -p ~/.ssh && chmod 700 ~/.ssh') put('~/.ssh/', keyfile) run('cat %s >> ~/.ssh/authorized_keys' % keyfile) run('rm %s' % keyfile)Everything you need to push your public key to an external server using Fabric.