Switching user in Fabric
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a problem when using Fabric to mimic my SSH workflow to deploy my web application. Here's my usual flow of commands when I SSH to a server: SSH using root user. ssh root@1.2.3.4 Switch to web user: su - web Change directory: cd /srv/web/prod/abc_project Start virtualenv: workon abc_env Perform git pull: git pull origin master Run a script: build_stuff -m build Run another script: ./run I tried to write this as a deploy script in Fabric and I get a shell output when su - web is entered. I have to hit Ctrl-D to continue the script. I am