Thank you so much for your help. I tried what you've suggested. It works! I am so happy for that. But there is still some warnings.
What I've done as below:
My redhat is a new server running redhat enterprise server 6. There isn't ssh2_config file. So like what I did yesterday, I uncommented a line contains 'X11Forwarding yes' in sshd_conf.
Back to Mac, in terminal, type 'xterm&'. In a X terminal, using ssh login to redhad, as Rod suggested. I can login but got two warnings:
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Although I got those warnings, I still typed xterm& and opened a new xterm which comes from redhat. Then try 'xclock&'. It displayed!! So great!
Now, I have an other question. I opened 'firefox' from xterm. Firefox was also booted up, but the letters on menu and top bar were blurred. And the warnings I got were:
Xlib: extension 'RANDR' missing on display 'localhost:10.0'.
Xlib: extension 'RANDR' missing on display 'localhost:10.0'.
Xlib: extension 'RANDR' missing on display 'localhost:10.0'.
Have you ever met such problem?
This is a new problem. But I already feel so happy that you help me solved a problem which had bothered me for more than three days! Thanks all your help!
Untrusted X11 Forwarding Setup Failed: Xauth Key Data Not Generated Free
'ssh -X'でX11フォワーディングをしようとすると、次のようなメッセージが出ます。 Warning: untrusted X11 forwarding setup failed: xauth key data not generated そして、うまくいきません (環境変数DISPLAYが設定されない)。'ssh. Warning: untrusted X11 forwarding setup failed: xauth key data not generated Warning: No xauth data; using fake authentication data for X11 forwarding. Is there something I can do to make this warning go away? If not, can I safely ignore it? X11 forwarding seems to work fine, though I do see this message. Warning: untrusted X11 forwarding setup failed: xauth key data not generated. Warning: No xauth data; using fake authentication data for X11 forwarding. Linux websever 2.6.35-gentoo-r4 #12 SMP PREEMPT Fri Apr 1 02:33:46 CEST 2011 i686. Warning: untrusted X11 forwarding setup failed: xauth key data not generated X11 forwarding request failed on channel 0 message when opening a connection with ssh -X, and when I tried to run an X application. Warning: untrusted X11 forwarding setup failed: xauth key data not generated Warning: No xauth data; using fake authentication data for X11 forwarding. This warning occurs due to the differences between the local client & remote server SSH X11 forwarding setup, but X11 forwarding is still usable. Nov 08, 2018 Question: Q: Warning: untrusted X11 forwarding setup failed: xauth key data not generated I'm trying to use X11 forwarding with ssh from my Mac (macOS 10.14 Mojave). I have XQuartz (2.7.11) installed, but when I do ssh -X hostname to a linux host I get the error. Warning: untrusted X11 forwarding setup failed: xauth key data not generated Warning: No xauth data; using fake authentication data for X11 forwarding. The xauth call seems to fail, so I tried (not knowing if thats the right way to solve this.).