tags:

views:

268

answers:

2

Every time fabric runs, it asks for root password, can it be sent along same for automated proposes.

fab staging test
+3  A: 

fab -h will show you all the options, you can also read them here.

In particular, and I quote,

-p PASSWORD, --password=PASSWORD

Sets env.password to the given string; it will then be used as the default password when making SSH connections or calling the sudo program.

Alex Martelli
Getting an accept without an upvote always makes me smile -- it's not about the rep, but what does it mean to say (via accept) "this is the answer that solved my problem" and at the same time _not_ say (via upvote) "this is a good answer"?!-)
Alex Martelli
Sans-upvote no more!
Matthew Rankin
+4  A: 

I know you've asked about password but wouldn't it better to configure the system so that you can doing fabric (i.e. SSH) without password?

For this, on local machine do:

  1. ssh-keygen and agree with all defaults (if you have no reasons do otherwise)
  2. cat ~/.ssh/id_rsa.pub and copy that key

On remote machine:

  1. mkdir ~/.ssh && chmod 600 ~/.ssh
  2. touch ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2
  3. Paste copied key into authorized_keys2

From now your remote machine “trusts” your local machine and allows logging it in without password. Handy.

nailxx