[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Fab-user] Key-based authentication and sudo
From: |
Jeff Forcier |
Subject: |
Re: [Fab-user] Key-based authentication and sudo |
Date: |
Thu, 25 Sep 2008 09:36:07 -0400 |
I don't recall if this is in the main branch, but my Github side
branch definitely has this sort of functionality :) I'm expecting that
once Christian or I get enough time, those sorts of changes from my
code will make it into one release or another.
Let's see...I think this was where it ended up:
http://github.com/bitprophet/fabric/tree/execution/fabric.py#L1195
-Jeff
On Thu, Sep 25, 2008 at 9:26 AM, <address@hidden> wrote:
> Hi,
>
> I'm a new Fabric user, and a fan. Good stuff. :)
>
> I noticed in the user guide, this paragraph:
>
> "If you have a private key that the servers will acknowledge, then Fabric
> will automatically pick it up, and if a password is required for unlocking
> that key, then Fabric will ask that password. This default behavior should
> work for most people, but if you use password-less keys, then note the
> caveat that Fabric won't ask for a password and this in turn means that the
> sudo() operation won't be able to parse a password to the sudo command on
> the remote hosts. To counter this, you need to specify, on the remote hosts,
> the commands you need for deployment as sudo'able without a password."
>
> I thought it might be worthwhile to point out that there's an alternative to
> making those commands sudo'able without a password:
>
>
> import getpass
> def sudo_cmd():
> "Run a command with sudo. Prompts for your password first."
> set (fab_password=getpass.getpass())
> prompt('command', 'Command')
> sudo(get('command'))
>
> The above snippet will work with ssh-key authentication, and has the added
> bonus of not echoing your sudo password on the screen.
>
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>
>