def push_key():
keyfile = '/tmp/%s.pub' % env.user
run('mkdir -p ~/.ssh && chmod 700 ~/.ssh')
put('~/.ssh/id_rsa.pub', 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.
comments powered by Disqus