2

I am trying to open a linode Debian 10 with display. I am connecting to it using a Git Bash on Windows 7.I have tried almost every way I can find, but cannot get rid of this error

debug1: Authentication succeeded (password).
Authenticated to 66.228.51.35 ([66.228.51.35]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: exec
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: No xauth program.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Linux localhost 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Jun 21 08:56:56 2021 from 49.36.179.155
root@localhost:~#

I have Xming on 0.0. This is my ssh_config.

# ssh_config(5) man page.

# Host *
   ForwardAgent yes
   ForwardX11 yes
   PasswordAuthentication yes
   XAuthLocation /opt/X11/bin/xauth
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   IdentityFile ~/.ssh/id_ecdsa
#   IdentityFile ~/.ssh/id_ed25519
   Port 22
   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
#   RekeyLimit 1G 1h
# Added by git-extra
Ciphers +aes128-cbc,3des-cbc,aes256-cbc,aes192-cbc

It is the same on the server as well. Don't know what else to do make it work. I am not a bit clear on where to add export DISPLAY in the bash on Windows..or server?

user@user-PC MINGW64 ~/Desktop
$ which xauth
which: no xauth in (/c/Users/user/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/user/bin:/c/Program Files (x86)/Microsoft SDKs/Azure/CLI2/wbin:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/geckodriver.exe:/c/Program Files/Java/jre1.8.0_271/bin/java:/cmd:/c/Program Files/wkhtmltopdf:/c/Program Files/Liquid Technologies/Liquid Studio 2021/XmlDataBinder19/Redist19/cpp/win32/bin:/c/Program Files/Liquid Technologies/Liquid Studio 2021/XmlDataBinder19/Redist19/cpp/win64/bin:/c/Users/user/AppData/Local/Programs/Python/Python37/Scripts:/c/Users/user/AppData/Local/Programs/Python/Python37:/c/Program Files/JetBrains/PyCharm Community Edition 2020.3/bin:/c/Users/user/AppData/Local/Programs/Microsoft VS Code/bin:/c/Program Files/poppler-0.68.0/bin:/c/Program Files/wkhtmltopdf:/c/Program Files/gs/gs9.54.0/bin:/c/Program Files/poppler-0.68.0/bin:/usr/bin/vendor_perl:/usr/bin/core_perl)
torek
  • 448,244
  • 59
  • 642
  • 775
Abhishek Rai
  • 2,159
  • 3
  • 18
  • 38
  • [This serverfault question](https://serverfault.com/questions/273847/what-does-warning-untrusted-x11-forwarding-setup-failed-xauth-key-data-not-ge) suggest to use `-Y` instead of `-X` (`-X` should only be used when necessary and isn't worth troubleshooting if `-Y` works). – Joachim Sauer Jun 21 '21 at 09:12
  • Same error, it gives. I have tried both. It is a problem with an `xauth` not present on Windows, I think, don't know how to do that. – Abhishek Rai Jun 21 '21 at 09:12
  • Not understanding enough of this to propose a duplicate, but did you read the answers at https://stackoverflow.com/questions/40056227/warning-no-xauth-data-using-fake-authentication-data-for-x11-forwarding? – tripleee Jun 21 '21 at 10:07
  • @triplee Oh yes. That one and many many more. I keep getting `no xauth`. The path of xauth on server is `/usr/bin/xauth`. There is no '`opt` folder there. Also simply cannot understand weather the client needs `xauth`? How to get that? – Abhishek Rai Jun 21 '21 at 10:09
  • @tripleee It logs me into the cli. I just want to be logged into the GUI desktop. Can the server not simply boot in the GUI mode? I tried that..didn't work. – Abhishek Rai Jun 21 '21 at 10:11
  • 1
    Wait ... Do you expect the Debian server to be running an X11 desktop and your Windows to be able to log in to that? Do you have reason to believe that the server is already running X11? Usually that's not how servers are set up. If you want that, probably start a VNC server on the Debian server, and connect using a VNC client. But unless your server is actually running graphical applications in production, you probably shouldn't. – tripleee Jun 21 '21 at 10:13
  • @tripleee I think you got it. That is what I wanted. Oh, so I need to do ..ok. Will look this up then. I want to run a scraper in the server. Would not be possible without the desktop environment. That is the issue. – Abhishek Rai Jun 21 '21 at 10:15
  • On the server: edit `/etc/ssh/sshd_config` — change `XAuthLocation /opt/X11/bin/xauth` to `/usr/bin/xauth` or comment it out as `/usr/bin/` is in the default `$PATH`. On the client: look up where `xauth` is in Xming, set the path in `ssh_config`. – phd Jun 21 '21 at 10:16
  • 1
    The way to run a scraper on a server is usually to set X11 to run headless, with `Xvfb`. You can run a real live graphical GUI, of course, but that's usually not worth it if that's your only use case ... and still that's not how you would log in to it. – tripleee Jun 21 '21 at 10:18
  • @tripleee So, a server cannot be open in an desktop environment? I mean we cannot log in to it remotely? with the GUI? – Abhishek Rai Jun 21 '21 at 10:22
  • 1
    Sure it can, but that's usually not how it's done. If you have a run of the mill Linode server, it will not be configured with anything like that, and probably no display card. – tripleee Jun 21 '21 at 10:25
  • @tripleee I get the whole picture now. Thanks a lot for your time and replies. – Abhishek Rai Jun 21 '21 at 10:27
  • 1
    This has nothing to do with Git or bash (git-bash is a port of bash to Windows, and also has nothing to do with Git), but does have to do with ssh, so I updated the tags. – torek Jun 21 '21 at 17:17

1 Answers1

1

What ssh -Y (not -X) is for, is to allow the host into which you are connecting, to open X11 windows on your own display. For this to work, your computer must be running an X server. On macOS (Darwin) for instance you would launch XQuartz. The ssh command can then provide, via environment variables and other clever tricks, a communications channel by which X client programs on the target machine can open windows on your server on your laptop.

To use this with Windows on a PC, you would need to install an X server on your PC. This is possible; see this Google search for instance. You mentioned Xming; this superuser.com Q&A has some setup information for using Xming.

torek
  • 448,244
  • 59
  • 642
  • 775