0

I have generated pair of both public and private key for one remote host. Now I want to add another private key in open format to connect via ssh to second remote host, but ssh denies connection with "Bad passphrase" when I want to add key with ssh-add "key_name". I only have private key, which in Putty on Windows machine works fine. I only have two files in my /home/user/.ssh directory:

id_dsa
known_hosts
muru
  • 197,895
  • 55
  • 485
  • 740
Alan Kis
  • 237
  • 1
    You don't need to add a new private key. You need one private key (that you have already generated). The public key (of that private-public pair) can be sent to as many remote hosts as you want. That's why it is "public". See this answer – user68186 Apr 16 '15 at 18:02
  • On my virtual machine key is working, on my host keeps hitting me with bad passphrase. – Alan Kis Apr 17 '15 at 20:14

1 Answers1

0

Easy as pie.

Simply go to the .ssh folder in your home and add the file config

nano /home/${USER}/.ssh/config

and add the following lines e.g.

Host duck-a-rub
HostName mail.man.com OR <IP-Address>
User rubberduck
Port 223
IdentityFile /full/path/to/keys/rubberduck_id_dsa

save the file and give it a try.

ssh duck-a-rub

HTH, s1mmel

s1mmel
  • 2,024