-1

I have already successfully set up an automatic ssh connection to a remote host on my (Mac) laptop (ssh-keygen, ssh-copy-id of the public key on the .ssh folder on the host machine, inserted the password once and now connects automatically). I would like to be able to do the same from the (Ubuntun 12) machine I use at work. Here's what I did: used ssh-keygen again, this time calling the keys id_rsa2 (differently from my laptop's which is the standard id_rsa) and here come's the problem: if I try to ssh-copy-id -i ~/.ssh/id_rsa2.pub user@hostname:/.ssh/ I get:

ssh: Could not resolve hostname hostename:/.ssh: Name or service not known 

but if I try to ssh user@hostmane, I am prompted to insert the password and it connects without problems. Any clue someone? thank you very much

andrea
  • 525
  • 1
  • 5
  • 21

1 Answers1

0

You should drop the :/.ssh/ from the end of your hostname:

ssh-copy-id -i ~/.ssh/id_rsa2.pub user@hostname
Anthony Geoghegan
  • 11,533
  • 5
  • 49
  • 56
  • [SOLVED] Thank you very much. now I can automatically ssh from both my laptop and my machine at work – andrea Jan 26 '15 at 14:52
  • Cool. Glad to hear it. Can you accept the answer by clicking the check-mark next to this answer? See http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – Anthony Geoghegan Jan 26 '15 at 15:29