fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Changing user with sudo and running commands as new user


From: Herman Schistad
Subject: Re: [Fab-user] Changing user with sudo and running commands as new user
Date: Mon, 22 Oct 2012 09:48:05 +0200

On Mon, Oct 22, 2012 at 6:28 AM, Rahul Menon <address@hidden> wrote:
> I had a similar situation where i had to use it like that. I ended up having
> a similar problem but my usecase was not extensive like yours. I ended up
> using something like "sudo ( 'su www -c ls')". I hope someone out there has
> a better answer for you.

Thanks for your answer Rahul, but your solution is (as you know), not
ideal as I am planning to run a series of commands, on of them a
prompt.
I was thinking something in the lines of:
with prefix("sudo su deploymentuser"):
    with cd("/home/deploymentuser/productioncode/"):
        # do commands
But it just feels wrong.

I hope someone else has some experience with this problem, as it can
not be a very unique one.

-- 
Sincerly,
Herman Schistad
ITK, Samfundet Trondheim



reply via email to

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