无法在 ssh 隧道上使用远程 x11vnc

无法在 ssh 隧道上使用远程 x11vnc

我想通过 vnc 连接到我工作中的桌面。以下是我操作的方法:

  • 我在远程机器上运行:

    autossh -M 8081 -NR 2222:本地主机:22 -p3082[电子邮件保护]

  • 我在本地机器上运行:

    ssh -vvv -NL 5900:localhost:5900 工作

定义工作.ssh/config

Host work
    Hostname localhost
    User censor
    Port 2222

并启动 x11vnc 服务器

export DISPLAY=:0
x11vnc

当使用 remmina 连接到地址 localhost:5900 时它只是闪烁然后消失。

x11vnc 的日志

24/07/2019 16:23:40 Got connection from client 127.0.0.1
24/07/2019 16:23:40   other clients:
24/07/2019 16:23:40 Normal socket connection
24/07/2019 16:23:40 Disabled X server key autorepeat.
24/07/2019 16:23:40   to force back on run: 'xset r on' (3 times)
24/07/2019 16:23:40 incr accepted_client=1 for 127.0.0.1:33082  sock=11
24/07/2019 16:23:40 Client Protocol Version 3.8
24/07/2019 16:23:40 Protocol version sent 3.8, using 3.8
24/07/2019 16:23:40 rfbProcessClientSecurityType: executing handler for type 1
24/07/2019 16:23:40 rfbProcessClientSecurityType: returning securityResult for client rfb version >= 3.8
24/07/2019 16:23:41 Pixel format for client 127.0.0.1:
24/07/2019 16:23:41   8 bpp, depth 8
24/07/2019 16:23:41   true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6
24/07/2019 16:23:41 copy_tiles: allocating first_line at size 61
24/07/2019 16:23:41 rfbProcessClientNormalMessage: ignoring unsupported encoding type ultraZip
24/07/2019 16:23:41 Using compression level 9 for client 127.0.0.1
24/07/2019 16:23:41 Using image quality level 0 for client 127.0.0.1
24/07/2019 16:23:41 Using JPEG subsampling 1, Q15 for client 127.0.0.1
24/07/2019 16:23:41 Enabling X-style cursor updates for client 127.0.0.1
24/07/2019 16:23:41 Enabling full-color cursor updates for client 127.0.0.1
24/07/2019 16:23:41 Enabling cursor position updates for client 127.0.0.1
24/07/2019 16:23:41 Enabling KeyboardLedState protocol extension for client 127.0.0.1
24/07/2019 16:23:41 Enabling NewFBSize protocol extension for client 127.0.0.1
24/07/2019 16:23:41 Enabling LastRect protocol extension for client 127.0.0.1
24/07/2019 16:23:41 Enabling SupportedMessages protocol extension for client 127.0.0.1
24/07/2019 16:23:41 Enabling SupportedEncodings protocol extension for client 127.0.0.1
24/07/2019 16:23:41 Enabling ServerIdentity protocol extension for client 127.0.0.1
24/07/2019 16:23:41 Using tight encoding for client 127.0.0.1
24/07/2019 16:23:41 client_count: 0
24/07/2019 16:23:41 Restored X server key autorepeat to: 1
24/07/2019 16:23:41 viewer exited.
24/07/2019 16:23:41 deleted 60 tile_row polling images.

ssh -vvv 的日志:

debug1: Connection to port 5900 forwarding to localhost port 5900 requested.
debug2: fd 9 setting TCP_NODELAY
debug2: fd 9 setting O_NONBLOCK
debug3: fd 9 is O_NONBLOCK
debug1: channel 5: new [direct-tcpip]
debug3: send packet: type 90
debug3: receive packet: type 91
debug2: channel 5: open confirm rwindow 2097152 rmax 32768
debug2: channel 5: window 1992972 sent adjust 104180
debug2: channel 5: read<=0 rfd 9 len -1
debug2: channel 5: read failed
debug2: channel 5: close_read
debug2: channel 5: input open -> drain
debug2: channel 5: ibuf empty
debug2: channel 5: send eof
debug3: send packet: type 96
debug2: channel 5: input drain -> closed
debug3: receive packet: type 96
debug2: channel 5: rcvd eof
debug2: channel 5: output open -> drain
debug2: channel 5: obuf empty
debug2: channel 5: close_write
debug2: channel 5: chan_shutdown_write: shutdown() failed for fd 9: Transport endpoint is not connected
debug2: channel 5: output drain -> closed
debug3: receive packet: type 97
debug2: channel 5: rcvd close
debug3: channel 5: will not send data after close
debug2: channel 5: send close
debug3: send packet: type 97
debug2: channel 5: is dead
debug2: channel 5: garbage collecting
debug1: channel 5: free: direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36686 to 127.0.0.1 port 5900, nchannels 6
debug3: channel 5: status: The following connections are open:
  #2 direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36662 to 127.0.0.1 port 5900 (t4 r0 i0/0 o3/0 fd 6/6 cc -1)
  #3 direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36664 to 127.0.0.1 port 5900 (t4 r1 i0/0 o3/0 fd 7/7 cc -1)
  #4 direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36666 to 127.0.0.1 port 5900 (t4 r2 i0/0 o3/0 fd 8/8 cc -1)
  #5 direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36686 to 127.0.0.1 port 5900 (t4 r3 i3/0 o3/0 fd 9/9 cc -1)

debug1: Connection to port 5900 forwarding to localhost port 5900 requested.
debug2: fd 9 setting TCP_NODELAY
debug2: fd 9 setting O_NONBLOCK
debug3: fd 9 is O_NONBLOCK
debug1: channel 5: new [direct-tcpip]
debug3: send packet: type 90
debug3: receive packet: type 92
channel 5: open failed: connect failed: Connection refused
debug2: channel 5: zombie
debug2: channel 5: garbage collecting
debug1: channel 5: free: direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36688 to 127.0.0.1 port 5900, nchannels 6
debug3: channel 5: status: The following connections are open:
  #2 direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36662 to 127.0.0.1 port 5900 (t4 r0 i0/0 o3/0 fd 6/6 cc -1)
  #3 direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36664 to 127.0.0.1 port 5900 (t4 r1 i0/0 o3/0 fd 7/7 cc -1)
  #4 direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36666 to 127.0.0.1 port 5900 (t4 r2 i0/0 o3/0 fd 8/8 cc -1)

我做错了什么?

相关内容