Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fabric password

Tags:

python

fabric

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

fab staging test 
like image 699
bocca Avatar asked Feb 26 '10 05:02

bocca


People also ask

What is Python Fabric?

Python. Fabric is a Python library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks. Fabric is very simple and powerful and can help to automate repetitive command-line tasks. This approach can save time by automating your entire workflow.

What is Fabric command?

More specifically, Fabric is: A tool that lets you execute arbitrary Python functions via the command line; A library of subroutines (built on top of a lower-level library) to make executing shell commands over SSH easy and Pythonic.

What is Fab Linux?

fab uses Python's optparse library, meaning that it honors typical Linux or GNU style short and long options, as well as freely mixing options and arguments. E.g. fab task1 -H hostname task2 -i path/to/keyfile is just as valid as the more straightforward fab -H hostname -i path/to/keyfile task1 task2 .


1 Answers

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 700 ~/.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.

like image 98
nkrkv Avatar answered Sep 30 '22 08:09

nkrkv