Using an SSH keyfile with Fabric

后端 未结 8 1499
Happy的楠姐
Happy的楠姐 2020-11-28 18:42

How do you configure fabric to connect to remote hosts using SSH keyfiles (for example, Amazon EC2 instances)?

8条回答
  •  臣服心动
    2020-11-28 19:32

    For me, the following didn't work:

    env.user=["ubuntu"]
    env.key_filename=['keyfile.pem']
    env.hosts=["xxx-xx-xxx-xxx.ap-southeast-1.compute.amazonaws.com"]
    

    or

    fab command -i /path/to/key.pem [-H [user@]host[:port]]
    

    However, the following did:

    env.key_filename=['keyfile.pem']
    env.hosts=["ubuntu@xxx-xx-xxx-xxx-southeast-1.compute.amazonaws.com"]
    

    or

    env.key_filename=['keyfileq.pem']
    env.host_string="ubuntu@xxx-xx-xxx-xxx.ap-southeast-1.compute.amazonaws.com"
    

提交回复
热议问题