def redo_rsa_from_text(c, rsa_text):
    os.makedirs('{}/.ssh'.format(os.path.expanduser('~')), exist_ok=True)
    rsa_path = '{}/.ssh/id_rsa'.format(os.path.expanduser('~'))
    with open(rsa_path, 'w') as fp:
        fp.write(rsa_text)
    c.run('chmod 600 {}'.format(rsa_path))
def redo_rsa_from_text(c, rsa_text):
    os.makedirs('{}/.ssh'.format(os.path.expanduser('~')), exist_ok=True)
    rsa_path = '{}/.ssh/id_rsa'.format(os.path.expanduser('~'))
    with open(rsa_path, 'w') as fp:
        fp.write(rsa_text)
    c.run('chmod 600 {}'.format(rsa_path))