Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?



migrated from stackoverflow.com May 4 '12 at 23:23

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

2 Answers 2

Tried entering hostname in your Terminal?


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.

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

This site is currently not accepting new answers.

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