我正在尝试在Fabric中切换用户:
def check_user():
with settings(user='linevich'):
run("whoami")
结果:
[root@127.0.0.1:10022] Executing task 'check_user'
[root@127.0.0.1:10022] run: whoami
[root@127.0.0.1:10022] Login password for 'linevich':
[root@127.0.0.1:10022] out: root
怎么了?
(不,我不想使用sudo()
。)
答案 0 :(得分:1)
解决方案: 我用以下命令启动脚本:
<script src="/Scripts/jquery-1.10.2.js"></script>
<script src="/Scripts/jquery.validate.js"></script>
<script src="/Scripts/jquery.validate.unobtrusive.js"></script>
<script src="/Scripts/jquery.validate.unobtrusive.bootstrap.js"></script>
<script src="/Scripts/site/myscript-1.0.js"></script>
正确的方法 - 运行而不设置用户名:
fab -H root@127.0.0.1:10022