Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This may be a pretty dump question!

So how do I get the host name so that I can ssh into my machine (which is a Mac)?

For instance : ssh myusername@<hostname> Is there any command to find out the hostname from the terminal?

[Edit] So I was able to find the host (thanks to your help! :) ). But I'm still getting 'Connection timed out' when trying to ssh into the machine. Actually, I can ssh into my machine from the VM that shared the same connection with this machine. Is there anything else (firewall option/etc) that I need to change to completely enable remote-login?


share|improve this question

migrated from May 4 '12 at 23:23

This question came from our site for professional and enthusiast programmers.

Tried entering hostname in your Terminal?

share|improve this answer

check under system preferences->sharing, when you enable remote login on your mac it will tell you right there what user and hostname to use.

share|improve this answer
Thanks! So I turned on the remote-login option. But when I tried to ssh from a different account, I keep getting connection timed out. Do you happen to know what else I need to change/re-configure in order to completely enable remote-login ? – One Two Three May 4 '12 at 20:09
As far as I know that is all you need, however Remote Login must either be set to all users or have the user you want in their list. I would expect you need to have a password set for that user as well. On my computer for instance, my user is vextorspace and my ip is and my domain is macbook.local so I can either do an ssh vextorspace@ or ssh vextorspace@macbook.local. The only things I have set under sharing are remote login and remote management. remote management is for vnc access. – vextorspace May 5 '12 at 12:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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