3

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?

Thanks

2 Answers 2

3

Tried entering hostname in your Terminal?

1
  • I need a command that obtains the full <hostname> when entered on the remote session. For me hostname does not return <hostname> but an abbreviation.
    – Kvothe
    Feb 5, 2021 at 11:30
1

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.

2
  • 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, 2012 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 192.168.1.112 and my domain is macbook.local so I can either do an ssh [email protected] or ssh [email protected]. The only things I have set under sharing are remote login and remote management. remote management is for vnc access. May 5, 2012 at 12:57

You must log in to answer this question.

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