17
   local$> echo $DISPLAY
   :0.0
   local$> ssh -X -i PEMFILE ec2-user@AMAZONEC2_AMI
   [ec2-user@REMOTE_AMI ~]$ echo $DISPLAY

   [ec2-user@REMOTE_AMI ~]$ sudo grep X11 /etc/ssh/sshd_config ~/.ssh/*
   /etc/ssh/sshd_config:#X11Forwarding no
   /etc/ssh/sshd_config:X11Forwarding yes
   /etc/ssh/sshd_config:#X11DisplayOffset 10
   /etc/ssh/sshd_config:#X11UseLocalhost yes

Hence the display is not forwarded. a command like emacs & for instance does not show the X11 window on the local desktop. Please advise.

Humble Debugger
  • 471
  • 3
  • 6
  • 15

3 Answers3

22

I did this:

sudo yum install xorg-x11-xauth.x86_64 xorg-x11-server-utils.x86_64 dbus-x11.x86_64

and I finally got a display variable and it all started to work!

OttoV
  • 336
1

I dont have reputation so posting the answer and it worked for me on amazon RHEL

sudo yum groupinstall "X Window System"
user4959
  • 111
1

Install from the above answer didn't work for my RHEL 6.2 EC2 instance. Here are steps that did work:

$ sudo yum groupinstall "X Window System"

# now disconnect and create a new SSH with -X option

devkev
  • 53