【问题标题】:fabric deploy remote - asking for password织物部署远程 - 要求输入密码
【发布时间】:2015-06-14 15:16:39
【问题描述】:

我有 Windows 7

我正在尝试:

env.hosts = ['xxx.xx.xx.xxx', 'xxx.xx.xx.xxx', 'xxx.xx.xx.xxx']
env.user = 'root'
env.key_filename = 'C:\Users\Doniyor\Desktop\ssh\secure-life\privkey.ppk'

def dm(): 
   app_path = '/var/www/myproj/'
   env_path = '/var/www/virtualenvs/myproj'
   with cd(env_path):
       run('. bin/activate')

   with cd(app_path):
       run('git pull origin master')
       run('python manage.py collectstatic --settings=myproj.settings')
       run('python manage.py migrate --settings=myproj.settings')
       run('touch conf/uwsgi.ini')

但它一直要求输入root密码:

这里缺少什么?我已经为此奋斗了将近 2 天..

【问题讨论】:

    标签: python django ssh fabric ssh-keys


    【解决方案1】:

    将该私钥添加为所有这些服务器上用户 root 的 SSH 密钥:

    ssh-copy-id root@123.45.56.78
    

    确保 SSH 代理也在运行。当您尝试使用 SSH 登录远程服务器时,SSH 代理会使用您的私钥进行身份验证。检查Running SSH Agent when starting Git Bash on Windows

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-19
    • 1970-01-01
    • 2011-03-17
    • 1970-01-01
    • 1970-01-01
    • 2022-01-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多