I'm trying to switch user in Fabric:
def check_user():
with settings(user='linevich'):
run("whoami")
Result:
[[email protected]:10022] Executing task 'check_user'
[[email protected]:10022] run: whoami
[[email protected]:10022] Login password for 'linevich':
[[email protected]:10022] out: root
What's wrong?
(No, I don't want to use sudo()
instead.)
Solution: I used following command to launch script:
Right way - run it without setting username: