Note that there are some explanatory texts on larger screens.

plurals
  1. POFabric not working when using ~/.ssh/config
    primarykey
    data
    text
    <p>I have the following configuration on my ~/.ssh/config</p> <pre><code>Host death-star HostName deathstar.empire.com User vader IdentityFile ~/.ssh/death_id_rsa </code></pre> <p>And the following fabfile</p> <pre><code>from fabric.api import env, task env.use_ssh_config = True @task def destroy_rebels(): run("echo Alderaan has been destroyed") </code></pre> <p>I'm calling the task like this:</p> <pre><code>$ fab --host death-star destroy_rebels </code></pre> <p>This is the output I get:</p> <pre><code>[death-star] Executing task 'destroy_rebels' [death-star] run: echo Alderaan has been destroyed Fatal error: run() received nonzero return code -1 while executing! Requested: echo Alderaan has been destroyed Executed: /bin/bash -l -c "echo Alderaan has been destroyed" Aborting. Disconnecting from vader@deathstar.empire.com... done. </code></pre> <p>I'm pretty sure the ssh config is correct since I can <code>ssh death-star</code> with no problems.</p> <p>Also, when I specify the hostname and use the default key for user root instead of using the ssh config file, it works:</p> <pre><code>$ fab --user root --host deathstar.empire.com destroy_rebels </code></pre> <p>Any ideas why this happens?</p> <p><strong>EDIT</strong>: This is my fabric version</p> <pre><code>$ fab --version Fabric 1.4.1 ssh (library) 1.7.13 </code></pre> <p><strong>EDIT 2</strong>: </p> <p>I've rewritten bits of the original post. I realized that the <code>root</code> (using the default key <code>id_rsa</code> always works, even using <code>.ssh/config</code>, if I add a new entry:</p> <pre><code>Host root-death-star HostName deathstar.empire.com User root IdentityFile ~/.ssh/id_rsa $ fab --host root-death-star destroy_rebels # this works </code></pre> <p>But using the non-root user <code>vader</code>, with its own key <code>death_id_rsa</code>, it doesnt. SSHing to the server is still working though, as root and as vader.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload