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.

Ok, so the scenario is this:

I have a G5 Quad (running Leopard) with no wireless card. The G5 is connected by Ethernet to a Mac Mini (running Lion), which is picking up my AirPort Extreme network over WiFi. The Mac Mini shares its internet connection over Ethernet to the G5, enabling it to connect to the internet perfectly. I can also screen share or SSH into the G5 from the Mac-Mini without any problems.

Now comes the trouble:

I have a MacBook Pro (running Lion) which also connects to the same WiFi network as the Mac Mini. I can see (and connect to) the Mac Mini from the MBP without trouble, but I cannot see or connect to the G5 from the MBP.

How can I configure this so that I can SSH or screen share the G5 from my MBP?

IPs and subnets of machines:

  • Mac Mini IP: 10.0.0.9
    Subnet Mask: 255.255.255.0

  • MBP IP: 10.0.0.4
    Subnet Mask: 255.255.255.0

  • G5 IP: 192.168.2.3
    Subnet Mask: 255.255.255.0

share|improve this question

1 Answer 1

Port forwarding VNC

If you use VNC for screen sharing it should be easy to just tunnel the port through the Mac Mini. So, from the MacBook Pro, you'd call:

ssh -L5900:192.168.2.3:5900 10.0.0.9

… where:

ssh -L<local-VNC-port>:<IP-of-G5>:<port-of-screensharing-at-G5> <IP-of-Mac-Mini>

This way, you'll have to actually connect to your localhost:5900 from the MacBook Pro (e.g. using Chicken of the VNC or a similar program).


SSH Proxy

If you can SSH from your Mac Mini to the G5, and from the MBP to the Mac Mini, then all you need is to "hop" over the Mac Mini to SSH to the G5 directly.

On your MacBook Pro, edit the file ~/.ssh/config (create it if it doesn't exist). Add the following:

Host g5
  User <username-for-Mac-Mini>
  HostName <hostname-of-Mac-Mini>
  ProxyCommand nohup ssh <hostname-of-G5> %h %p

The next time you want to connect to your G5, just call ssh g5. You will be directly connected to the G5. You could replace the host names with IPs too, if you like.

share|improve this answer
    
Hey thanks for the advice. I'm mostly interested in getting ssh access, so I've been trying the above without success. I get this error: ssh_exchange_identification: Connection closed by remote host –  i0n Oct 31 '11 at 12:20
    
@i0n Do you have any private key authentication set up? Can you try again with IP addresses instead of using hostnames? –  slhck Oct 31 '11 at 12:33
    
I have private/public key pairs for github. I already tried it with the IPs, it didn't make any difference. –  i0n Oct 31 '11 at 12:59
    
@i0n Can you check Console.app on both machines for any relevant error messages when you try SSH? Also, running ssh -v should give you more verbose output. Almost all I find online is related to a missing /var/empty directory on one machine. –  slhck Oct 31 '11 at 13:41
1  
In the end I just settled for: ssh -t ian@Mini-Mac.local ssh ian@G5.local –  i0n Nov 1 '11 at 22:09

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.