9

I recently bought a Macbook Air with Lion. I would like to ssh into my Mac at work. How do I set this up?

I have a private and public key, so I will likely use that option to allow access into my mac.

5
  • 2
    What did you try so far?
    – Daniel Beck
    Feb 27, 2012 at 17:41
  • This should give you the guidance you need: stocksy.co.uk/articles/Mac/ssh_on_mac_os_x Feb 27, 2012 at 17:46
  • Thanks, I have tried altering Apple -> System Preferences -> Sharing -> Remote Login and then sshing into my mac air with ssh [email protected] as the instructions told me. However, this method fails since the terminal notes that the host dhcp-12-259-119-81.yale.edu is not recognized.
    – David Faux
    Feb 27, 2012 at 18:19
  • By the way, this IP address is fake, so I didn't reveal anything :)
    – David Faux
    Feb 27, 2012 at 18:24
  • 1
    You seem to be behind a firewall that's blocking SSH access from outside. Could that be? From where are you trying to SSH in, actually? You can also try to find out your real computer's IP (not the dhcp-.. hostname) and ssh to that.
    – slhck
    Feb 27, 2012 at 18:47

3 Answers 3

10

Apple -> System Preferences -> Sharing -> Remote Login.

3
  • It shows the IP of the local network, how can I ssh from the outside?
    – ilyo
    Jan 8, 2015 at 13:54
  • You can't, @ilyo. Private addresses are only locally accessible. Jan 9, 2015 at 14:59
  • 1
    I know I can't use that address outside, I'm asking how can I ssh to the mac from the outside.
    – ilyo
    Jan 9, 2015 at 15:13
4

If you want to be able to SSH from work to home, you'll need to do the following:

  • Get the external IP address of your home network. You can obtain this by going to this website. If you ISP changes your IP frequently, you'll have to use something like Dyn DNS.

  • Open port 22 on your firewall/router and point it to the local IP address of the Mac you want to connect to. Instructions for this step vary on your firewall/router model. You may want to set up a DHCP reservation for this Mac so the internal IP address doesn't change.

  • On the Mac your want to connect to, open System Preferences → Sharing and enable Remote Login.

  • You should now be able to run the command ssh [email protected], replacing "user" with the home computer's username and the "ip.of.your.mac" with the home IP address.

2
  1. Simply activate the option in Preferences : "Remote login".

  2. Access your mac :

    ssh [email protected]

You must log in to answer this question.

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