SSH 使用虚假身份验证进行 X11 转发

SSH 使用虚假身份验证进行 X11 转发

ssh -X -v说我没有 xauth 数据并且它使用虚假身份验证进行 X11 转发?

我已将 ssh_config X11 设置为“是”。sshd_config 也一样。

在中/etc/ssh/ssh_config,我已从#端口 22 和协议 2 中删除了井号字符并添加XauthLocation /usr/bin/xauth,但它仍然无法识别它?

我的目标是通过 ssh 连接到另一台计算机并在该计算机上打开 firefox 或 xclock、leafpad、发送通知等……

当我使用时,我让它只以一种方式工作,xhost +但我不喜欢使用它。

sudo cat /etc/ssh/ssh_config | grep X11
ForwardX11 yes
ForwardX11Trusted yes

sudo cat /etc/ssh/sshd_config | grep X11
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no

以下是输出ssh -X -v

OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 192.168.5.22 [192.168.5.22] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/kasutaja/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/kasutaja/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/kasutaja/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/kasutaja/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/kasutaja/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/kasutaja/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/kasutaja/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/kasutaja/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.4 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.5.22:22 as 'kasutaja'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
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
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:s6nPrSaS0Xv70nUEuen+/KI7VY504pGwTBwFokztLSw
debug1: Host '192.168.5.22' is known and matches the ECDSA host key.
debug1: Found key in /home/kasutaja/.ssh/known_hosts:7
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/kasutaja/.ssh/id_rsa
debug1: Trying private key: /home/kasutaja/.ssh/id_dsa
debug1: Trying private key: /home/kasutaja/.ssh/id_ecdsa
debug1: Trying private key: /home/kasutaja/.ssh/id_ed25519
debug1: Next authentication method: password
[email protected]'s password: 
debug1: Authentication succeeded (password).
Authenticated to 192.168.5.22 ([192.168.5.22]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: exec
debug1: client_input_global_request: rtype [email protected] want_reply 0
Warning: No xauth data; using fake authentication data for X11 forwarding.
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Sending environment.
debug1: Sending env LC_PAPER = et_EE.UTF-8
debug1: Sending env LC_ADDRESS = et_EE.UTF-8
debug1: Sending env LC_MONETARY = et_EE.UTF-8
debug1: Sending env LC_NUMERIC = et_EE.UTF-8
debug1: Sending env LC_TELEPHONE = et_EE.UTF-8
debug1: Sending env LC_IDENTIFICATION = et_EE.UTF-8
debug1: Sending env LANG = et_EE.UTF-8
debug1: Sending env LC_MEASUREMENT = et_EE.UTF-8
debug1: Sending env LC_TIME = et_EE.UTF-8
debug1: Sending env LC_NAME = et_EE.UTF-8
Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 4.4.0-127-generic x86_64)

答案1

我已经修好了!

解决方案是Arch Linux 论坛

我尝试了这个命令who并且效果很好。

它输出如下内容:

kasutaja tty8         2018-05-25 09:44 (:1)

(:1)表明我export DISPLAY=:1不需要:0

:1我不知道为什么:0

这解决了我的问题。

有谁知道如何更改DISPLAY=:1:0,请告诉我。

我检查了/etc/environment~/.bashrc发现没有DISPLAY设置:O

如果我发现它很快,我会更新这个答案。

相关内容