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
2
  • 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, 2015 at 18:02
  • On my virtual machine key is working, on my host keeps hitting me with bad passphrase.
    – Alan Kis
    Apr 17, 2015 at 20:14

1 Answer 1

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

1
  • ah, add as many hosts as you like :)
    – s1mmel
    Apr 17, 2015 at 18:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .