使用Fabric在EC2中运行命令

时间:2018-04-27 03:40:12

标签: python amazon-ec2 passwords fabric

我正在学习Python中的Fabric,以便从远程实例EC2(AWS)运行命令。这是我的简单脚本:

UPDATE auction a
  JOIN auc_due_table d 
    ON d.auction_id     = a.auctionID 
   AND d.auc_due_time   = a.total_time
   AND d.auc_due_price <> a.auc_final_price

  LEFT
  JOIN bidbutler b
    ON b.auc_id         = a.auctionID
   AND b.auc_id         = d.auction_id
   AND b.butler_status <> 0        

  SET b.butler_status   = 0
    , a.auc_status      = 2 

 WHERE a.auc_status     = 3

但是,当我运行脚本from fabric.api import * env.hosts = ['ec2-**-****-**-**.compute.amazonaws.com'] env.user = 'ubuntu' env.key_filename = 'myKey.pem' def update(): run('mkdir Hello') 时,我会收到以下消息:

fab update

此时我不知道需要输入哪个密码!有没有办法跳过密码请求?

非常感谢你的帮助!

0 个答案:

没有答案