I have a server A which ssh-keygen produce a .ssh2 direcotry and id_dsa_2048_a* files and a server B which ssh-keygen produce a .ssh directory and id_rsa* files and a server C like B

How can auto login into B from A, or login into A from B (ssh without password)?

I can setup auto login from B to C.


1 Answer 1


Yeah, just define the hosts in your ~.ssh/config file:

Host hostB
    ProxyCommand ssh -q -W %h:%p hostA
  • There is no .ssh in hostA, so I assume I should do it in hostB?
    – Sato
    Oct 16, 2014 at 8:38
  • As far as I understand you want to login from your workstation to serverB using serverA as a hop-station. If so, you need to modify the .ssh/config on your workstation.
    – neutrinus
    Oct 16, 2014 at 8:48
  • Sorry, I mean directly..
    – Sato
    Oct 16, 2014 at 9:07
  • So use ssh-copy-id
    – neutrinus
    Oct 16, 2014 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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