I have OS X and within it installed Ubuntu 13.04 via Parallels 8, and I also have iMac, within it I installed Ubuntu 12.04 (not Virtual Environment). So, now I have three OS - OS X, Ubuntu 13.04, and Ubuntu 12.04 (from here on I use OS name to specify each machine/environment).

When I tried to connect to Ubuntu 12.04 from OS X via SSH by running ssh username@hostname, then it worked as expected. However, when I tried to type in the same command on Ubuntu 13.04 to try to connect to Ubuntu 12.04 via SSH, then the error ssh: Could not resolve hostname myhostname: Name or service not known occurred.

Now I want to connect to Ubuntu 12.04 from Ubuntu 13.04, since some files I want to send out are stored on Ubuntu 13.04. However, it looks like even if I type in the exactly same command, I cannot connect on one environment but can on the other one. Why does this happen and how can I fix it?

I'm not entirely sure, but I'm worried about whether a machine which is allowed to be connected from another machine via SSH can connect itself to yet another one via SSH...

Here's a current situation:

OS X -> Ubuntu 12.04 --- succeed
OS X -> Ubuntu 13.04 --- succeed
Ubuntu 12.04 -> Ubuntu 13.04 --- failed
Ubuntu 13.04 -> Ubuntu 12.04 --- failed

For your information I set up the configuration where I copy id_rsa.pub on my client and paste it in authorized_keys in my server.



Almost all *nix boxes are both SSH clients and servers. "Could not resolve hostname" means you have DNS issues... Try using the IP of the other box. Also, because you're inside of Parallels, your virtual networking is probably using NAT, which will make it difficult/impossible to connect between boxes.

  • Thanks. When I tried to connect via ssh username@ip_address syntax between two Ubuntu machines, then I got the error Permission denied (publickey).. I did exactly the same thing on Ubuntu with regards to setting configuration as on OS X (i.e. copy id_rsa.pub and paste it in server's authorized_keys file)... – Blaszard Aug 12 '13 at 16:30
  • Permission denied is progress - that means you're reaching the other side and it just doesn't like you... Try putting both ssh and sshd into debug mode and see if you get any hints. – BowlesCR Aug 12 '13 at 17:20
  • I can't get what you mean in putting both ssh and sshd into debug mode... If I typed in ssh username@ip_address, then the above error message is shown, whereas I typed in sshd username@ip_address instead then sshd re-exec requires execution with an absolute path is shown on the screen. ssh is /usr/bin/ssh and sshd is /usr/sbin/sshd, for your information (not sure whether it's related in this issue)... – Blaszard Aug 12 '13 at 18:38

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.