Penerusan X11 rusak

8

Saya tidak bisa menjalani hidup saya untuk maju terus bekerja. Saya melakukan semuanya 'berdasarkan buku' ... Baik klien dan server menjalankan ubuntu 11.04. Keduanya memiliki port ssh, vnc, x11 dan FW terbuka

/etc/ssh/ssh_config

   ForwardAgent yes
   ForwardX11 yes
   ForwardX11Trusted yes

/etc/ssh/sshd_config

X11Forwarding yes
X11DisplayOffset 10

apt-get install xauth
xauth is already the newest version.
  • menginstal tightvncserver
  • menjalankan daftar xauth
  • reboot
  • terhubung dengan ssh server -Xvl user

echo $DISPLAY kembali, pengembalian xterm kosong xterm Xt error: Can't open display:

xterm:  DISPLAY is not set
  • FW terbuka
  • VNCserver berjalan
  • sshd berjalan
  • X11 berjalan
  • file konfigurasi ssh ok
  • keluaran verbose dari ssh login menunjukkan semua ok, tidak ada kesalahan

Masih tidak ada yang berhasil ...

Jadi saya lakukan export DISPLAY=localhost:10.0 Kemudian echo $DISPLAYkembali localhost:10.0tetapi xtermkembalixterm Xt error: Can't open display: localhost:10.0

Sekarang inilah bagian yang aneh. jika saya lakukan export DISPLAY=:0.0maka xterm tidak memberikan kesalahan, tetapi tidak ada GUI yang ditampilkan ...

Mencoba segalanya kecuali menginstal ulang OS. Bahkan menginstal ulang ssh dan menyalin file konfigurasi baru dari instalasi yang berfungsi ...

Menempatkan di sini keluaran verbose:

user@jupiter:~$ ssh -v -X [email protected] env
OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.0.1 [192.168.0.1] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/id_rsa type -1
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.8p1 Debian-1ubuntu3
debug1: match: OpenSSH_5.8p1 Debian-1ubuntu3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.8p1 Debian-1ubuntu3
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 31:52:3e:91:b2:b2:74:cf:3e:65:37:a7:78:b9:3a:9e
debug1: Host '192.168.0.1' is known and matches the ECDSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:4
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
debug1: Next authentication method: publickey
debug1: Trying private key: /home/user/.ssh/id_rsa
debug1: Trying private key: /home/user/.ssh/id_dsa
debug1: Trying private key: /home/user/.ssh/id_ecdsa
debug1: Next authentication method: password
debug1: Authentication succeeded (password).
Authenticated to 192.168.0.1 ([192.168.0.1]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Requesting authentication agent forwarding.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending command: env
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
SHELL=/bin/bash
XDG_SESSION_COOKIE=5867400390852a975845598400000005-1329602079.30299-1173119600
SSH_CLIENT=192.168.0.14 34691 22
USER=user
SSH_AUTH_SOCK=/tmp/ssh-bPyNW11158/agent.11158
MAIL=/var/mail/user
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
PWD=/home/user
LANG=en_US.UTF-8
SHLVL=1
HOME=/home/user
LOGNAME=user
SSH_CONNECTION=192.168.0.14 34691 192.168.0.1 22
_=/usr/bin/env
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 1960, received 1968 bytes, in 0.1 seconds
Bytes per second: sent 19601.4, received 19681.4
debug1: Exit status 0
Botol
sumber
Oh ya, dan saya tidak mendapatkan entri di syslog atau kernel log
JaR
Hai Pertanyaan cepat untuk Anda sobat. Ketika Anda dempul ke kotak Anda. Apakah Anda ssh ke kotak lain dan mencoba meneruskan X11? mis: Putty (box1) -> ssh box2 -> penerusan X11 jika ya. Tidak akan berhasil. X11 hanya bekerja langsung dari dempul. Penanganan masalah -> membuat terowongan ke kotak baru dan X11 itu :)

Jawaban:

6

Saya menghabiskan lebih beberapa jam untuk melihat yang satu ini dan mencoba hampir semuanya.

Sangat berpengalaman dalam menggunakan SSH.
Aneh itu menambahkan baris ini yang membuatnya bekerja / etc / ssh / sshd_config X11UseLocalhost no

CUKY
sumber
Terima kasih banyak! hanya ketiadaan garis ini yang menjadi sumber masalah dalam kasus saya.
John Smith
3

Tidak yakin apakah Anda masih peduli selama ini setelah Anda bertanya, tapi saya memecahkan masalah yang sama hari ini.

Anda perlu menambahkan: X11UseLocalhost no ke /etc/ssh/sshd_configdan memulai kembali server SSH.

Anda mungkin juga perlu menambahkan .Xauthorityfile untuk host penghubung ke host X remote:

xauth add {ip}:0 . {32byte code from `xauth list` on the connecting host}

di mana {ip}IP dari host X jarak jauh dan xauth listdijalankan pada host penghubung lokal.

Darian
sumber
2

Yah, saya tidak punya masalah, saya selalu bisa membuatnya bekerja dengan cukup mudah, tapi mungkin saya bisa membantu dengan membandingkan koneksi kerja saya. Saya terhubung ke sistem server saya, bernama "myserver", dengan nama login "myname", menggunakan rsa, bukan kata sandi (nama telah diubah). Omong-omong, ini mudah dilakukan dengan beberapa perintah pada sistem lokal.

$ ssh -v -X myserver env
OpenSSH_5.8p1 Debian-7ubuntu1, OpenSSL 1.0.0e 6 Sep 2011
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to myserver [192.168.1.111] port 22.
debug1: Connection established.
debug1: identity file /home/myname/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/myname/.ssh/id_rsa-cert type -1
debug1: identity file /home/myname/.ssh/id_dsa type -1
debug1: identity file /home/myname/.ssh/id_dsa-cert type -1
debug1: identity file /home/myname/.ssh/id_ecdsa type -1
debug1: identity file /home/myname/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3p1 Debian-3ubuntu7
debug1: match: OpenSSH_5.3p1 Debian-3ubuntu7 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.8p1 Debian-7ubuntu1
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: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA de:ad:be:ef:00:ff:00:5c:1a:65:8e:01:73:4a:96:da
debug1: Host 'myserver' is known and matches the RSA host key.
debug1: Found key in /home/myname/.ssh/known_hosts:1
debug1: ssh_rsa_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
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/myname/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to myserver ([192.168.1.111]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Sending environment.
debug1: Sending env LC_MESSAGES = en_US.UTF-8
debug1: Sending env LC_COLLATE = en_US.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_CTYPE = en_US.UTF-8
debug1: Sending command: env
SHELL=/bin/bash
XDG_SESSION_COOKIE=d509ffb7a28e82163e2349554bdbc5ab-1329602932.440753-1239879281
SSH_CLIENT=192.168.1.110 48888 22
USER=myname
MAIL=/var/mail/myname
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
LC_MESSAGES=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
PWD=/home/myname
LANG=en_US.UTF-8
SHLVL=1
HOME=/home/myname
LOGNAME=mynage
SSH_CONNECTION=192.168.1.110 48888 192.168.1.111 22
LC_CTYPE=en_US.UTF-8
DISPLAY=localhost:10.0
_=/usr/bin/env
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2912, received 2760 bytes, in 0.5 seconds
Bytes per second: sent 5503.1, received 5215.8
debug1: Exit status 0

Sunting: Oh, ya, file konfigurasi: ssh_config ... Tidak satu pun dari ketiganya yang disetel sama sekali; berkomentar.

Hanya ini yang ditetapkan:

SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no

sshd_config ... Sama seperti milik Anda, dengan tambahan ini di akhir:

UsePAM yes

Oh, dan pada host jarak jauh:

$ echo $DISPLAY
localhost:10.0
Marty Fried
sumber
Saya tidak pernah menggunakan server vnc, jadi ini mungkin masalahnya. Hanya ingin tahu - mengapa Anda perlu menggunakannya? Saya tidak bisa memikirkan alasan untuk menambahkan ini untuk linux ke linux, tapi saya jelas tidak banyak ahli.
Marty Fried