[OS X] turn on ssh X11 forwarding

Andy Jacobson andyj at splash.princeton.edu
Thu Oct 20 10:23:44 EDT 2005


Howdy,

     By default, X11 forwarding is turned off on OS X.  This means  
that when you log in to your OS X machine from some remote place, you  
won't be able to display X11 windows back  to that place.  To turn it  
on:

     become root (e.g., sudo tcsh)
     edit /etc/sshd_config
     uncomment the X11Forwarding line and change 'no' to 'yes.  it  
should look like:
X11Forwarding yes
     save it
     restart sshd, via "SystemStarter -v restart SSH"
     unbecome root

      Check to make sure it works by sshing in (-X option might be  
necessary, depending on your remote client).  Then echo $DISPLAY and  
you should see something like "localhost:10.0".

     It is bad practice to blindly set DISPLAY in your .cshrc  
(or .bashrc) files.  In my .cshrc, I
only set it if it isn't already set:

if ( $?DISPLAY == 0 ) then
     setenv DISPLAY localhost:0
endif

     Cheers,

         Andy

--
Andy Jacobson

andy.jacobson at noaa.gov

Program in Atmospheric and Oceanic Sciences
Sayre Hall, Forrestal Campus
Princeton University
PO Box CN710 Princeton, NJ 08544-0710 USA

Tel: 609/258-5260  Fax: 609/258-2850






More information about the OSX mailing list