title: Store a private key outside of ~/.ssh
body: <p>I have to deal with a rather annoying situation. I must transfer a file via shell script using scp from one server to another. The problem is that I do not have root access on either of them. I'm not allowed to install any packages like, sshpass, ssh2, expect etc. I don't even have write permission in the home directory of the user I have to use on the second server. </p>
  
  <p>Since I can't use sshpass etc. to enable my script to enter the login credentials, I thought about using an ssh keypair for auth. Actually that was my first thought, but since the user on the second server doesn't have write permissions in its home directory but only in a subsequent directory, ssh-keygen fails as it can't put the keys in ~/.ssh.</p>
  
  <p>Both are Debian servers btw. </p>
  
  <p>Is there any way to generate a ssh keypair and use it outside of ~/.ssh?</p>
  
  <p>Any help is greatly appreciated.</p>