title: Permission denied when cloning git repo through shell script
body: <p>From a server (A) I launch a script called test.sh which contains this code :</p>
  <pre><code>#!/bin/bash
  
  ssh login@server-b.com -p 22 'bash $HOME/tmp/git.sh'
  
  exit 0
  </code></pre>
  <p>So from server (B) another script is launched (called git.sh) and contains :</p>
  <pre><code>#!/bin/bash
  
  cd $HOME/tmp
  git clone ssh://repo_login@my-repo.com:22/home/scripts
  
  exit 0
  </code></pre>
  <p>But the git clone does not work and I get this error message :</p>
  <pre><code>Cloning into 'scripts'...
  Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  </code></pre>
  <p>But from server (B) If I launch the git.sh script manually, it works.</p>
  <p>Do you have an idea why?</p>
  <p>Thanks
  L.</p>