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.
Best Answer
I did this:
and I finally got a display variable and it all started to work!