Fabric要求输入root密码 [英] Fabric asks for root password
本文介绍了Fabric要求输入root密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Fabric运行以下命令:
I am using Fabric to run the following:
def staging():
""" use staging environment on remote host"""
env.user = 'ubuntu'
env.environment = 'staging'
env.hosts = ['host.dev']
_setup_path()
def bootstrap():
""" initialize remote host environment (virtualenv, deploy, update) """
require('root', provided_by=('staging', 'production'))
run('mkdir -p %(root)s' % env)
run('mkdir -p %s' % os.path.join(env.home, 'www', 'log'))
create_virtualenv()
deploy()
update_requirements()
但是我明白了:
ubuntu@host.dev:~/projects/proj_name$ fab staging bootstrap
[host.dev] run: mkdir -p /home/ubuntu/www/staging
Password for ubuntu@host.dev:
为什么Fabric要求我输入密码?这是默认的ubuntu根用户,在sudoers文件中没有密码.这是怎么回事?
Why is Fabric asking for my password? This is the default ubuntu root user which has no password in the sudoers files. What's going on here?
推荐答案
meta:刚刚意识到这个问题仍然没有答案.我不知道那里到底发生了什么,但这是一个猜测.
这可能是由于连接到禁用了纯文本密码SSH连接的计算机时未使用密钥文件引起的.
This was probably caused by failing to use a keyfile when connecting to a machine where plaintext password SSH connection was disabled.
正确的用法是:
fab -i keyfile.pem <fabric_task>
这篇关于Fabric要求输入root密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文