fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] put with use_sudo=True


From: Jeff Forcier
Subject: Re: [Fab-user] put with use_sudo=True
Date: Sun, 25 Nov 2012 17:29:20 -0800

Hi Julien, sorry for the late reply!

On Wed, Nov 14, 2012 at 7:15 AM, Julien Cigar <address@hidden> wrote:

> I'm connecting as user "foo", and "foo" is able to "sudo -u bar" on remote
> host.
>
> with:
> env.sudo_user = "bar"
>
> I'm running:
> put(src, dst, use_sudo=True)
>
> <snip>
>
> 4) The operation fails with a "Permission denied" wich is logical, as file
> is owner by foo:foo and sudo -u bar mv foo dst will never work ..

You're not missing anything -- the use_sudo argument to put() is
solely a convenience shortcut for a common use case. Your needs don't
fit this use case, so using it (as you saw) isn't going to work.

Instead, I'd put() to a location both users can read, and then
sudo('cp') (vs the implicit sudo('mv') which won't work) -- or
whatever's most appropriate to your situation.

Best,
Jeff


-- 
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]