web-dev-qa-db-ja.com

X11転送:INIT Serverにできません:接続できませんでした:接続が拒否されました。 X11接続に必要なものは何ですか?

SSHからのX11接続によって、NO GUI Debian Serverbuntu Desktopをコントロールしたいです。私が読んで見たすべてのものから、それはLinuxの気持ちの魅力のように働くべきですが、それはそうではありません。

# The debian /etc/ssh/sshd_config:

...
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
...

保存後、Debianでsshdを再起動しました。
[。]接続したとき:ssh -X debianからbunt(ポートとユーザーで設定しています)接続と入力を確立した後:gedit次の手順を実行しますエラー:

user@debian:~$ gedit
Unable to init server: Could not connect: Connection refused

(gedit:26888): Gtk-WARNING **: 17:00:04.268: cannot open display: 

同じX11構成のUbuntuにインストールされているopenssh-serverもあります。私はそれが必要であるかどうかわかりませんが、とにかく試しました。

私はx11の間でx11が2つのLinux Distrosの間で働く必要がありません。だから私は何もインストールする必要はなく、DebianサーバーはX11クライアントです。

[。] GUIプログラムを接続して実行するのに役立ちます。

編集1:

user@ubuntu:~$ ssh -X -vvv debian

OpenSSH_8.3p1 Ubuntu-1ubuntu0.1, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /home/*******/.ssh/config
debug1: /home/*******/.ssh/config line 1: Applying options for debiando
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolving ********* port *****
debug2: ssh_connect_direct
debug1: Connecting to ************************
debug1: Connection established.
debug1: identity file /home/*******/.ssh/***_id_rsa type 0
debug1: identity file /home/*******/.ssh/***_id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.3p1 Ubuntu-1ubuntu0.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.9p1 Debian-10+deb10u2
debug1: match: OpenSSH_7.9p1 Debian-10+deb10u2 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to *****************
debug3: put_Host_port: *******************
debug3: hostkeys_foreach: reading file "/home/*********/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/********/.ssh/known_hosts:5
debug3: load_hostkeys: loaded 1 keys from ************
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c
debug2: Host key algorithms: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,[email protected],rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected],zlib
debug2: compression stoc: none,[email protected],zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
debug2: Host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected]
debug2: compression stoc: none,[email protected]
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: curve25519-sha256
debug1: kex: Host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server Host key: ecdsa-sha2-nistp256 SHA256:NvDOG/B9cRs6ML8cvw8BZ/Kv68dy52FwLKfYR69e4DA
debug3: put_Host_port: **************
debug3: put_Host_port: *********************
debug3: hostkeys_foreach: reading file "/home/*******/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/*******/.ssh/known_hosts:5
debug3: load_hostkeys: loaded 1 keys from **************
debug3: hostkeys_foreach: reading file "/home/*******/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/*******/.ssh/known_hosts:6
debug3: load_hostkeys: loaded 1 keys from *********************
debug1: Host '**************' is known and matches the ECDSA Host key.
debug1: Found key in /home/*******/.ssh/known_hosts:5
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /home/*******/.ssh/****_id_rsa RSA SHA256:OmiK3okiaARnd7XRw4d+y/LUaPREzcujUo4C4Ac+Hp4 explicit agent
debug1: Will attempt key: *******@KK-flash RSA SHA256:O6QLIsdS+t9UO0IyAsk14PaM+RQocYYcXlxf6CuK7UE agent
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/*******/.ssh/*****_id_rsa RSA SHA256:OmiK3okiaARnd7XRw4d+y/LUaPREzcujUo4C4Ac+Hp4 explicit agent
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: /home/*******/.ssh/****_id_rsa RSA SHA256:OmiK3okiaARnd7XRw4d+y/LUaPREzcujUo4C4Ac+Hp4 explicit agent
debug3: sign_and_send_pubkey: RSA SHA256:OmiK3okiaARnd7XRw4d+y/LUaPREzcujUo4C4Ac+Hp4
debug3: sign_and_send_pubkey: signing using rsa-sha2-512 SHA256:OmiK3okiaARnd7XRw4d+y/LUaPREzcujUo4C4Ac+Hp4
debug3: send packet: type 50
debug3: receive packet: type 52
debug1: Authentication succeeded (publickey).
Authenticated to ****************************
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting [email protected]
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: exec
debug3: receive packet: type 80
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug3: receive packet: type 4
debug1: Remote: /home/*******/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug3: receive packet: type 4
debug1: Remote: /home/*******/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: x11_get_proto: /usr/bin/xauth  list :1 2>/dev/null
debug1: Requesting X11 forwarding with authentication spoofing.
debug2: channel 0: request x11-req confirm 1
debug3: send packet: type 98
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x10
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug3: send packet: type 98
debug1: Sending environment.
debug3: Ignored env Shell
debug3: Ignored env SESSION_MANAGER
debug3: Ignored env QT_ACCESSIBILITY
debug3: Ignored env COLORTERM
debug3: Ignored env XDG_CONFIG_DIRS
debug3: Ignored env XDG_MENU_PREFIX
debug3: Ignored env GNOME_DESKTOP_SESSION_ID
debug3: Ignored env MANDATORY_PATH
debug1: Sending env LC_ADDRESS = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env GNOME_Shell_SESSION_MODE
debug1: Sending env LC_NAME = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env SSH_AUTH_SOCK
debug3: Ignored env XMODIFIERS
debug3: Ignored env DESKTOP_SESSION
debug1: Sending env LC_MONETARY = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env SSH_AGENT_PID
debug3: Ignored env GTK_MODULES
debug3: Ignored env PWD
debug3: Ignored env LOGNAME
debug3: Ignored env XDG_SESSION_DESKTOP
debug3: Ignored env XDG_SESSION_TYPE
debug3: Ignored env GPG_AGENT_INFO
debug3: Ignored env XAUTHORITY
debug3: Ignored env WINDOWPATH
debug3: Ignored env HOME
debug3: Ignored env USERNAME
debug3: Ignored env IM_CONFIG_PHASE
debug1: Sending env LC_PAPER = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env LS_COLORS
debug3: Ignored env XDG_CURRENT_DESKTOP
debug3: Ignored env VTE_VERSION
debug3: Ignored env GNOME_TERMINAL_SCREEN
debug3: Ignored env QT_DEVICE_PIXEL_RATIO
debug3: Ignored env LESSCLOSE
debug3: Ignored env XDG_SESSION_CLASS
debug3: Ignored env TERM
debug1: Sending env LC_IDENTIFICATION = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env DEFAULTS_PATH
debug3: Ignored env LESSOPEN
debug3: Ignored env LIBVIRT_DEFAULT_URI
debug3: Ignored env USER
debug3: Ignored env GNOME_TERMINAL_SERVICE
debug3: Ignored env DISPLAY
debug3: Ignored env SHLVL
debug1: Sending env LC_TELEPHONE = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env PT7HOME
debug3: Ignored env QT_IM_MODULE
debug1: Sending env LC_MEASUREMENT = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env XDG_RUNTIME_DIR
debug1: Sending env LC_TIME = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env XDG_DATA_DIRS
debug3: Ignored env PATH
debug3: Ignored env GDMSESSION
debug3: Ignored env DBUS_SESSION_BUS_ADDRESS
debug1: Sending env LC_NUMERIC = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env GOPATH
debug3: Ignored env _
debug2: channel 0: request Shell confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug3: receive packet: type 4
debug1: Remote: No xauth program; cannot forward X11.
debug3: receive packet: type 100
debug2: channel_input_status_confirm: type 100 id 0
X11 forwarding request failed on channel 0
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: Shell request accepted on channel 0
Linux debianserver 4.19.0-16-cloud-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: Wed Jun 16 17:19:01 2021 from 83.4.50.208
kDeb:~$ debug2: client_check_window_change: changed
debug2: channel 0: request window-change confirm 0
debug3: send packet: type 98
debug2: client_check_window_change: changed
debug2: channel 0: request window-change confirm 0
debug3: send packet: type 98
1
Kacper Kwaśny

答え:
[。]両側にXAUTHをインストールします。Sudo apt-get install xauth

DEBUGGIGGINGをオンにしているのかを見つけるにはsshそれは次のようにして行われます。
[。]スイッチを使用する-v-vv-vvvが最後に最も深い情報を与えます。

私が見つけたデバッグメッセージの最後に最初のスイッチを使用することによって:
[。] debug1: Remote: No xauth program; cannot forward X11..

2
Kacper Kwaśny