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 have two MacBook Pros on my home network. I have followed the advice in the below question to be able to SSH into them:

How do you run a SSH server on Mac OS X?

However, how would I issue the command to SSH into them from:

  1. Within my home wireless network?
  2. From a work computer outside of my home network?

My home network is using a Linksys WRT54G router and both computers are connected wirelessly.

share|improve this question
    
just a shot in the dark but check out chaoticsoftware.com/ProductPages/NetworkBeacon.html –  Robert S Ciaccio Sep 29 '10 at 18:04

1 Answer 1

For computers on your local network you use the private IP address e.g.

$ ssh 192.168.0.1

To connect from outside your network then you need the IP address of your router and you need to make sure that you have port 22 routed to the appropriate machine on your local network, and then you can just do:

$ ssh ww.xx.yy.zz

where ww.xx.yy.zz is your external (public) IP address.

share|improve this answer
    
whatismyip.com will show you your external IP –  ridogi Jul 26 '10 at 18:37
    
So from outside, I wont be able to choose which machine I ssh into? –  SuperUser12 Jul 26 '10 at 18:42
    
You will need to specify in your router settings which local IP address receives incoming connections on port 22. This is because you only have one external IP address. If you need to access more than one machine you'll have to use port mapping e.g. port 22 -> 192.168.0.1:22, port 10022 -> 192.168.0.2:22, port 10122 -> 192.168.0.3:22, etc. –  Paul R Jul 26 '10 at 18:55
1  
On your LAN, you can also use Bonjour names, like $ ssh user@MyMacBook.local If you want to get classy, look into DynDNS.com to assign a domain name to your router (it's free) and check out Tomato Router Firmware (google that) to have your router automatically update your dns server if your dynamic IP ever changes. With that firmware, you can also designate certain ethernet hardware addresses to be assigned static IPs (through DHCP) on your network, so you don't have to reforward when the LAN IP would otherwise change. –  NReilingh Jul 26 '10 at 20:51

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.