-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
Trying to use file.append with sudo option:
# ctx is fabric context
files.append(ctx, filename='/home/foo/.profile', text='export foo=bar', sudo=True)The underneath cmd looks like:
sudo -S -p '[sudo] password: ' echo 'export foo=bar' >> /home/foo/.profileand giving err msg:
bash: /home/foo/.profile: Permission denied
Also tried with runner_method='sudo' or runner=ctx.sudo and facing same issue
Found something might related
https://unix.stackexchange.com/questions/4335/how-to-insert-text-into-a-root-owned-file-using-sudo
ianfp, lryta, brumar, tehfink and dannystaple
Metadata
Metadata
Assignees
Labels
No labels