Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is a VM ubuntu server I am using which is named vm.

I used to remotely log into it through SSH public key.

But now I need to use ssh to other servers FROM vm, ex. pushing to heroku.

There is an unexpected results for that:

  1. When use my local console to remote control vm, use ssh push won't succeed, it complains about failed publickey.
  2. However, when I use the vm directly (from the linux terminal), I could push with ssh without error.

My first thought would be some mis-configuration of the ssh key forwarding, any clues for me to solve this problem?

share|improve this question
Have you tried the "-a" option for ssh from your local console, to completely disable forwarding agent? – erickzetta Mar 6 '12 at 15:53
up vote 0 down vote accepted

You need to forward your SSH key when you connect to the machine VM :

ssh -A user@VM
share|improve this answer
Why should I enable key forwarding? – steveyang Mar 6 '12 at 16:49
If you have the ssh key on your machine you have to use the forwarding. If there is only a password authentification on heroku thé you have to disable the forwarding with the option -a. And If you need a ssh key on VM you have to use the option -i /path/to/your.key. – Blueicefield Mar 6 '12 at 22:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.