0
로깅 사용자에서 시스템 사용자로 전환하고 해당 사용자로 명령을 실행할 수 있습니까? 직물 사용.시스템 사용자로 fabric 실행 명령
def sometask():
run('mkdir foo')
@hosts([email protected])
def dothis()
with change_user(user2):<-- this is what i want to do change user to user2 who is a system user with no password and can't login via ssh
with cd('~'): <-- cd to users ~
sometask() <-- run this as user2
yetanothertask() <-- run this as user2
.............
관련 : http://stackoverflow.com/questions/12641514/switch-to-different-user-using-fabric 및 http://stackoverflow.com이 좀처럼 보이는 뭔가 것/questions/10144430/fabric-and-sudo-as-another-user를 사용하십시오. – alecxe