Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Leopard: Remote SSH access

Leopard: Remote SSH access
Thread Tools
kga1978
Fresh-Faced Recruit
Join Date: Jan 2007
Status: Offline
Reply With Quote
Apr 29, 2008, 05:08 PM
 
Sorry for being a bit of a noob here, but I have a few questions/problems, that I was hoping some of you SuperTechs could help me with. Basically I am trying to connect to a remote Mac (running 10.5.2 with SSH/remote access enabled) using X11/Terminal and be able to open up programs on the computer, which will then be displayed on the connecting computer (a bit like screensharing - so say - open a safari window on the remote computer, which will be displayed on the connecting/local computer).

Here is what I am trying to do ("local >" = connecting computer running X11 or Terminal; "remote >" = logged onto the remote computer):

local > ssh -Y user@remote
remote > cd /Applications
remote > open Safari.app

Now, safari will open on the remote machine, but not on the connecting machine (which is what I am trying to do). If I try to open a xterm window on the remote machine:

remote > xterm

I get a DISPLAY not set/cannot open error. If I do this:

remote > echo $DISPLAY

I basically just get a blank space so it looks like this:

remote > echo $DISPLAY

remote >


And then nothing..... I have tried to enable X11 forwarding in the sshd_config file, but that doesn't help either. I have also tried to login with -X rather than -Y, but that doesn't work either.

Am I doing something really obviously wrong here? I am fairly new to SSH in general - which may be obvious from my post
     
Art Vandelay
Professional Poster
Join Date: Sep 2002
Location: New York, NY
Status: Offline
Reply With Quote
Apr 29, 2008, 06:31 PM
 
Safari isn't an X11 app. X11 forwarding is only going to work with X11 apps.

Read this for more info on using X11.
Configuring and Running X11 Applications on Mac OS X
Vandelay Industries
     
Simon
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Apr 30, 2008, 03:59 AM
 
If you want to remotely run non-X11 GUI apps, you're going to need VNC. You can tunnel that through SSH too. Performance-wise it's not as good as real remote X11 forwarding, but it is a feasible work-around to get that behavior with non-X11 apps.
     
kga1978  (op)
Fresh-Faced Recruit
Join Date: Jan 2007
Status: Offline
Reply With Quote
Apr 30, 2008, 04:48 PM
 
=..... you're going to need VNC. You can tunnel that through SSH too.
Thanks for the response guys - I figured that I was being a bit of a noob here. Tunnelling VNC through SSH though sounds interesting. Any directions on that?

Cheers.
     
Simon
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Apr 30, 2008, 05:32 PM
 
Originally Posted by kga1978 View Post
Thanks for the response guys - I figured that I was being a bit of a noob here. Tunnelling VNC through SSH though sounds interesting. Any directions on that?
It's actually quite easy.

• On the Mac you want to run the app, turn on VNC sharing in Sys Prefs > Sharing > Remote Management > Computer Settings > VNC viewer may ...

• On the other Mac open the ssh tunnel:
Code:
ssh [email protected] -L 59000:otherMac.wherever.com:5900
launch VNC and connect to localhost:59000. Use the password you chose in step 1.

Chicken of the VNC is very popular, but it's no longer being actively developed. JollysFastVNC is not quite as feature-rich (yet - it's still in alpha), but it is being developed and it is fast.

Let us know if you need any more help.
     
kga1978  (op)
Fresh-Faced Recruit
Join Date: Jan 2007
Status: Offline
Reply With Quote
May 1, 2008, 07:58 AM
 
Hi Simon,

Thanks very much, that worked very nicely! However, in order for me to do the SSH tunnelling trick in my lab, I have to go via a 'relay' computer. Basically the SSH traffic would go like this:

SSH from local -> [relay -> remote]

where the computers in [ ] are on a different local network. So basically if I have the following addresses:

local wan ip: 131.111.1.2
relay wan ip: 131.111.10.2
relay lan ip: 10.0.0.2
remote lan ip: 10.0.3

The way I initially tested your method connected directly via SSH from my local machine to the remote machine, and that worked very well. But my sys admin wants me to connect via the relay computer (for obvious reasons I guess) and then SSH from the relay computer to the remote computer, which is on the same local network as the relay.

So what I would normally have to do to establish a SSH connection would be something like this:

local > ssh -X [email protected]

relay > ssh -Y [email protected]

remote > _


Any ideas as to how I could now create a SSH tunnel to transfer the VNC traffic under these circumstances?

Thanks very much for your help,
Kristian
     
Simon
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
May 1, 2008, 01:37 PM
 
I'm sure there's a more elegant solution, but 2 tunnels (one from the local to the relay and one from the relay to the remote) will of course work.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 04:54 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,