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.

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.

share|improve this question
2  
What did you try so far? –  Daniel Beck Feb 27 '12 at 17:41
    
This should give you the guidance you need: stocksy.co.uk/articles/Mac/ssh_on_mac_os_x –  xXPhenom22Xx Feb 27 '12 at 17:46
    
Thanks, I have tried altering Apple -> System Preferences -> Sharing -> Remote Login and then sshing into my mac air with ssh davidfaux@dhcp-12-259-119-81.yale.edu 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 '12 at 18:19
    
By the way, this IP address is fake, so I didn't reveal anything :) –  David Faux Feb 27 '12 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 '12 at 18:47
add comment

3 Answers

up vote 8 down vote accepted

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

share|improve this answer
add comment

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 user@ip.of.your.mac, replacing "user" with the home computer's username and the "ip.of.your.mac" with the home IP address.

share|improve this answer
add comment
  1. Simply activate the option in Preferences : "Remote login".

  2. Access your mac :

    ssh username@ip.of.your.mac

share|improve this answer
add comment

Your Answer

 
discard

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.