Find the answer to your Linux question:
Results 1 to 4 of 4
Hello. I want to be able to execute programs from Linux on Windows XP in LAN with Cygwin+X11 on Windows. I'm able to ssh, change files on Windows, display e.g. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2013
    Posts
    9

    SSH Linux->Windows with Cygwin and X11


    Hello.

    I want to be able to execute programs from Linux on Windows XP in LAN with Cygwin+X11 on Windows.

    I'm able to ssh, change files on Windows, display e.g. xclock in my computer from Windows but I can't display anything in Windows (e.g. notepad).

    The sshd service is running on Windows and I've started X11 as well (with startxwin.exe).

    After writing in command line "xclock" a clock is displayed on my computer. When I write:
    Code:
    DISPLAY=:0.0
    ...and then write:
    Code:
    xclock &
    ...it's not displayed on my screen and I can see it running in "ps" (processes list). I can't see it, though, on the remote computer with Windows.

    I'm sshing like this:
    Code:
    ssh 192.168.1.x -l user -XY -v
    The result is:
    Code:
    OpenSSH_6.1p1, OpenSSL 1.0.1h 5 Jun 2014
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 20: Applying options for *
    debug1: Connecting to 192.168.1.x [192.168.1.x] port 22.
    debug1: Connection established.
    debug1: identity file /home/kokosek/.ssh/id_rsa type 1
    debug1: identity file /home/kokosek/.ssh/id_rsa-cert type -1
    debug1: identity file /home/kokosek/.ssh/id_dsa type -1
    debug1: identity file /home/kokosek/.ssh/id_dsa-cert type -1
    debug1: identity file /home/kokosek/.ssh/id_ecdsa type -1
    debug1: identity file /home/kokosek/.ssh/id_ecdsa-cert type -1
    debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
    debug1: match: OpenSSH_6.6.1 pat OpenSSH*
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_6.1
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: server->client aes128-ctr hmac-md5 none
    debug1: kex: client->server aes128-ctr hmac-md5 none
    debug1: sending SSH2_MSG_KEX_ECDH_INIT
    debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    debug1: Server host key: ECDSA 59:37:c2:76:d3:bb:6b:24:ef:c1:d7:5c:43:98:59:4f
    debug1: Host '192.168.1.x' is known and matches the ECDSA host key.
    debug1: Found key in /home/kokosek/.ssh/known_hosts:17
    debug1: ssh_ecdsa_verify: signature correct
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: Roaming not allowed by server
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug1: Authentications that can continue: publickey,password,keyboard-interactive,hostbased
    debug1: Next authentication method: publickey
    debug1: Offering RSA public key: /home/kokosek/.ssh/id_rsa
    debug1: Server accepts key: pkalg ssh-rsa blen 279
    debug1: key_parse_private_pem: PEM_read_PrivateKey failed
    debug1: read PEM private key done: type <unknown>
    Enter passphrase for key '/home/kokosek/.ssh/id_rsa':
    debug1: read PEM private key done: type RSA
    debug1: Authentication succeeded (publickey).
    Authenticated to 192.168.1.x ([192.168.1.x]:22).
    debug1: channel 0: new [client-session]
    debug1: Requesting no-more-sessions.openssh
    debug1: Entering interactive session.
    debug1: Requesting X11 forwarding with authentication spoofing.
    debug1: Sending environment.
    debug1: Sending env LANG = pl_PL.UTF-8
    Last login: Sun Jun 15 20:08:47 2014 from 192.168.1.x
    Permissions on the server:
    Code:
    /etc/ssh*
    -rw-r--r--  1 user root   1593 06-15 02:26 ssh_config
    -rw-r--r--  1 user root    668 06-14 20:49 ssh_host_dsa_key
    -rw-r--r--  1 user root    602 06-14 20:49 ssh_host_dsa_key.pub
    -rw-r--r--  1 user root    227 06-14 20:49 ssh_host_ecdsa_key
    -rw-r--r--  1 user root    174 06-14 20:49 ssh_host_ecdsa_key.pub
    -rw-r--r--  1 user root    399 06-14 20:49 ssh_host_ed25519_key
    -rw-r--r--  1 user root     94 06-14 20:49 ssh_host_ed25519_key.pub
    -rw-r--r--  1 user root    977 06-14 20:49 ssh_host_key
    -rw-r--r--  1 user root    642 06-14 20:49 ssh_host_key.pub
    -rw-r--r--  1 user root   1675 06-14 20:49 ssh_host_rsa_key
    -rw-r--r--  1 user root    394 06-14 20:49 ssh_host_rsa_key.pub
    -rw-r--r--  1 user root   3612 06-15 17:11 sshd_config
    
    ~/
    drwx------+ 1 user Brak    0 06-15 16:54 .ssh
    
    ~/.ssh
    -rw-------  1 user Brak 405 06-15 16:54 authorized_keys
    -rw-r--r--  1 user Brak 346 06-14 20:10 known_hosts
    Content of /etc/ssh_config on the server:
    Code:
    Host *
       ForwardX11 yes
       ForwardX11Trusted yes
       Port 22
       Protocol 2
    Content of /etc/sshd_config on the server:
    Code:
    Port 22
    AddressFamily any
    Protocol 2
    StrictModes no
    AuthorizedKeysFile      .ssh/authorized_keys
    HostbasedAuthentication yes
    X11Forwarding yes
    X11DisplayOffset 10
    X11UseLocalhost yes
    UsePrivilegeSeparation sandbox          # Default for new installations.
    Subsystem       sftp    /usr/sbin/sftp-server
    Any ideas how to do it?

  2. #2
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,133
    From my understanding, Windows applications aren't running within X so therefore cannot be X-forwarded. I'm not sure there's an equivalent technology other than full-blown Citrix.

  3. #3
    Just Joined!
    Join Date
    Nov 2013
    Posts
    9
    Even if I installed X11 within Cygwin? Shouldn't it enable me to display e.g. the clock?
    Moreover, here you can see xclock on Windows (we know it's Windows because of PuTTY):
    en.wikipedia.org/wiki/Cygwin#mediaviewer/File:Cygwin_X11_rootless_WinXP.png

    Moreover, xclock is not a main reason I want it. I'd prefer to open from my Linux new Notepad.

    After running:
    Code:
    notepad &
    ..."ps" shows me:
    Code:
    5192    5508    5192       5832  pty3    1004 23:04:44 /cygdrive/c/WINDOWS/system32/notepad
    ...but I can't see open Notepad on Windows.

  4. #4
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,133
    I would have thought Cygwin programme should have worked, just that I would have expected Notepad to run remotely. I may be wrong as it's a gold few years since I've played with Cygwin but it just didn't seem right to me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •