[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Failed to run Emacs in X windows mode on remote host over ssh with X
From: |
Hongyi Zhao |
Subject: |
Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled. |
Date: |
Wed, 28 Jul 2021 15:19:32 +0800 |
On Wed, Jul 28, 2021 at 3:14 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Tue, Jul 27, 2021 at 11:35 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
> >
> > On Tue, Jul 27, 2021 at 11:07 PM Skip Montanaro
> > <skip.montanaro@gmail.com> wrote:
> > >
> > > > $ grep ^X11Forwarding /etc/ssh/sshd_config
> > > > X11Forwarding yes
> > >
> > > Is this on the remote host or your ssh client host? Have you checked
> > > for X11 forwarding at both ends?
> >
> > On server side:
> >
> > $ grep ^X11Forwarding /etc/ssh/sshd_config
> > X11Forwarding yes
> >
> > On client side:
> >
> > $ grep '^[ ]*ForwardX11' /etc/ssh/ssh_config
> > ForwardX11 yes
> >
> > > Maybe this web page will help you debug the problem:
> > >
> > > https://www.poftut.com/linux-x11-connection-rejected-wrong-authentication-error-solution/
> >
> > I've checked all the aspects list there, but still meet the same error.
>
> Finally, I figured out the solution. See the discussion on
> comp.unix.shell [1] for more details. I listed below, for reference
> only, the successful methods that I finally tried out.
Sorry, I'm in a hurry and missed the content that I should post here.
Please see below:
Obtain the value of `$DISPLAY' locally on the ssh server:
$ echo $DISPLAY
:1
Then all the following methods will do the trick:
Method 1:
$ ssh -X -f wer...@192.168.10.100 DISPLAY=:1 emacs
or
$ ssh -X -f wer...@192.168.10.100 env DISPLAY=:1 emacs
Method 2:
$ ssh -X wer...@192.168.10.100
Then run any of the following commands:
$ DISPLAY=:1 emacs
$ env DISPLAY=:1 emacs
$ emacs -d :1
$ emacs --display :1
NB.
[1]. I obtain the clues from here: <https://kb.iu.edu/d/acxu>
[2]. X server relevant options supplied by Emacs:
werner@X10DAi:~$ man emacs|grep -A 4 -- '-d '
-d displayname, --display=displayname
Create the Emacs window on the display specified by dis‐
playname. Must be the first option specified in the com‐
mand line.
werner@X10DAi:~$ emacs --help|grep -- '-d '
--display, -d DISPLAY use X server DISPLAY
Regards
--
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province