Ssh

好:出錯並退出

  • September 8, 2019

我正在開發執行 Raspbian GNU/Linux 10 (buster) 的 Raspberry Pi Zero W。其他 X11 應用程序,如xlogoxclockxosview,甚至xeyes執行得很好,但我沒有運氣執行oneko

pi@nalzoks-pi:~ $ oneko
Display not supported shape extension.
oneko: Error and exit.
BadAccess (attempt to access private resource denied)
pi@nalzoks-pi:~ $ oneko -noshape
oneko: Error and exit.
BadAccess (attempt to access private resource denied)
pi@nalzoks-pi:~ $ sudo oneko
sudo: oneko: command not found

我在本地網路中通過 SSH 訪問 Pi 並使用 X11 轉發。

任何想法?


如果您需要,這裡有更多資訊

在 Pi Zero 上(使用 SSH 伺服器訪問ssh -X pi@nalzoks-pi.local

pi@nalzoks-pi:~ $ echo $DISPLAY
nalzoks-pi:11.0
pi@nalzoks-pi:~ $ sudo lsof -i -P -n | grep LISTEN
autossh   1608    pi    3u  IPv4  19696      0t0  TCP 127.0.0.1:30001 (LISTEN)
ssh       1613    pi    4u  IPv6  19718      0t0  TCP [::1]:30000 (LISTEN)
ssh       1613    pi    5u  IPv4  19719      0t0  TCP 127.0.0.1:30000 (LISTEN)
sshd      1719  root    3u  IPv4  20283      0t0  TCP *:22 (LISTEN)
sshd      1719  root    4u  IPv6  20289      0t0  TCP *:22 (LISTEN)
sshd      7110    pi   10u  IPv4  38831      0t0  TCP *:6010 (LISTEN)
sshd      7110    pi   11u  IPv6  38832      0t0  TCP *:6010 (LISTEN)
sshd      7394    pi   10u  IPv4  40700      0t0  TCP *:6011 (LISTEN)
sshd      7394    pi   11u  IPv6  40701      0t0  TCP *:6011 (LISTEN)
pi@nalzoks-pi:~ $ xdpyinfo
name of display:    nalzoks-pi:11.0
version number:    11.0
vendor string:    The X.Org Foundation
vendor release number:    11804000
X.Org version: 1.18.4
maximum request size:  16777212 bytes
motion buffer size:  256
bitmap unit, bit order, padding:    32, LSBFirst, 32
image byte order:    LSBFirst
number of supported pixmap formats:    7
supported pixmap formats:
   depth 1, bits_per_pixel 1, scanline_pad 32
   depth 4, bits_per_pixel 8, scanline_pad 32
   depth 8, bits_per_pixel 8, scanline_pad 32
   depth 15, bits_per_pixel 16, scanline_pad 32
   depth 16, bits_per_pixel 16, scanline_pad 32
   depth 24, bits_per_pixel 32, scanline_pad 32
   depth 32, bits_per_pixel 32, scanline_pad 32
keycode range:    minimum 8, maximum 255
focus:  None
number of extensions:    2
   BIG-REQUESTS
   XC-MISC
default screen number:    0
number of screens:    1

screen #0:
 dimensions:    1440x878 pixels (381x232 millimeters)
 resolution:    96x96 dots per inch
 depths (7):    24, 1, 4, 8, 15, 16, 32
 root window id:    0x111
 depth of root window:    24 planes
 number of colormaps:    minimum 1, maximum 1
 default colormap:    0x21
 default number of colormap cells:    256
 preallocated pixels:    black 0, white 16777215
 options:    backing-store NO, save-unders NO
 largest cursor:    32x32
 current input event mask:    0x1a0000
   StructureNotifyMask      SubstructureNotifyMask   SubstructureRedirectMask
 number of visuals:    80
 default visual id:  0x22
 visual:
   visual id:    0x22
   class:    TrueColor
   depth:    24 planes
   available colormap entries:    256 per subfield
   red, green, blue masks:    0xff0000, 0xff00, 0xff
   significant bits in color specification:    8 bits
 visual:
   visual id:    0xc1
   class:    TrueColor
   depth:    24 planes
   available colormap entries:    256 per subfield
   red, green, blue masks:    0xff0000, 0xff00, 0xff
   significant bits in color specification:    8 bits

 ... similar line omitted for brevity ...

在 MacBook Pro(SSH 客戶端)上

$ echo $DISPLAY
:0
$ xdpyinfo
name of display:    :0
version number:    11.0
vendor string:    The X.Org Foundation
vendor release number:    11804000
X.Org version: 1.18.4
maximum request size:  16777212 bytes
motion buffer size:  256
bitmap unit, bit order, padding:    32, LSBFirst, 32
image byte order:    LSBFirst
number of supported pixmap formats:    7
supported pixmap formats:
   depth 1, bits_per_pixel 1, scanline_pad 32
   depth 4, bits_per_pixel 8, scanline_pad 32
   depth 8, bits_per_pixel 8, scanline_pad 32
   depth 15, bits_per_pixel 16, scanline_pad 32
   depth 16, bits_per_pixel 16, scanline_pad 32
   depth 24, bits_per_pixel 32, scanline_pad 32
   depth 32, bits_per_pixel 32, scanline_pad 32
keycode range:    minimum 8, maximum 255
focus:  None
number of extensions:    25
   Apple-DRI
   Apple-WM
   BIG-REQUESTS
   DAMAGE
   DOUBLE-BUFFER
   GLX
   Generic Event Extension
   MIT-SCREEN-SAVER
   MIT-SHM
   Present
   RANDR
   RECORD
   RENDER
   SECURITY
   SGI-GLX
   SHAPE
   SYNC
   X-Resource
   XC-MISC
   XFIXES
   XINERAMA
   XInputExtension
   XKEYBOARD
   XTEST
   XVideo
default screen number:    0
number of screens:    1

screen #0:
 dimensions:    1440x878 pixels (381x232 millimeters)
 resolution:    96x96 dots per inch
 depths (7):    24, 1, 4, 8, 15, 16, 32
 root window id:    0x111
 depth of root window:    24 planes
 number of colormaps:    minimum 1, maximum 1
 default colormap:    0x21
 default number of colormap cells:    256
 preallocated pixels:    black 0, white 16777215
 options:    backing-store NO, save-unders NO
 largest cursor:    32x32
 current input event mask:    0x1a0000
   StructureNotifyMask      SubstructureNotifyMask   SubstructureRedirectMask
 number of visuals:    80
 default visual id:  0x22
 visual:
   visual id:    0x22
   class:    TrueColor
   depth:    24 planes
   available colormap entries:    256 per subfield
   red, green, blue masks:    0xff0000, 0xff00, 0xff
   significant bits in color specification:    8 bits
 visual:
   visual id:    0xc1
   class:    TrueColor
   depth:    24 planes
   available colormap entries:    256 per subfield
   red, green, blue masks:    0xff0000, 0xff00, 0xff
   significant bits in color specification:    8 bits

 ... similar line omitted for brevity ...

當您通過 ssh 從 Mac 登錄到 Pi 時,客戶端程序 (oneko) 在 Pi 上執行,並聯繫在 Mac 上執行的 X 伺服器。

我只是通過從我的 MacBook 登錄到我的 Debian PC 來嘗試這個ssh,並且oneko執行良好,當我這樣做時xdpyinfo,我看到的擴展數量與我xdpyinfo直接在我的 Mac 上看到的相同。

但是,在您的情況下,轉發的連接完全不同:

number of extensions:    2
 BIG-REQUESTS
 XC-MISC

這是很少擴展的方式,特別是沒有形狀。所以現在的問題是為什麼會發生這種情況。

我看到您有兩個 X 轉發登錄(sshd 在 6010 和 6011 上都監聽)。當您只使用一次登錄時會發生什麼?

編輯

要將評論的結果添加到答案中:有必要使用 ssh 和受信任的轉發(即ssh -Y,而不是ssh -X)以使所有擴展都可用。

引用自:https://unix.stackexchange.com/questions/539647