深度終端No xauth program; cannot forward with spoofing. X11 forwarding request failed on channel

環境

Deepin 15.11

問題

#深度終端鏈接遠程服務器時總是卡在以下的位置
Remote: No xauth program; cannot forward with spoofing.
X11 forwarding request failed on channel 0

現象

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
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Sending environment.
debug1: Sending env LANG = zh_CN.UTF-8
debug1: Sending command: echo \346\254\242\350\277\216\344\275\277\347\224\250\346\267\261\345\272\246\347\273\210\347\253\257\357\274\214 \345\234\250\346\202\250\344\275\277\347\224\250\345\217\263\351\224\256\350\217\234\345\215\225\350\277\233\350\241\214\344\270\212\344\274\240\345\222\214\344\270\213\350\275\275\346\226\207\344\273\266\344\271\213\345\211\215\357\274\214 \350\257\267\345\205\210\347\241\256\344\277\235\346\234\215\345\212\241\345\231\250\345\267\262\347\273\217\345\256\211\350\243\205\344\272\206rz\345\222\214sz\345\221\275\344\273\244\343\200\202 && exec $SHELL -l
debug1: Remote: No xauth program; cannot forward with spoofing.
X11 forwarding request failed on channel 0

解決

安裝ssh

# 查看是否有ssh進程是否啓動
ps -ef |grep ssh

一、更新源列表
sudo apt-get update
二、安裝服務器
sudo apt-get install openssh-server
三、啓動服務器
sudo service ssh restart
或者 
/etc/init.d/ssh start

修改配置文件

root@kunzai:/etc/ssh# vim /etc/ssh/ssh_config

###在最後一行增加配置文件
IPQoS 0x00

解釋說明:
    IPQoS 指令用於 IP 層的 type-of-service,默認爲“ lowdelay ” 和 "throughput".
    我的路由器之前 WAN 口雙播,不是很穩定。
    在添加 IPQoS 0x00 指令前,每次 ssh 都會失敗。
    在添加 IPQoS 0x00 指令後,每次 ssh 都會成功,但是建立鏈接花費的時間很長, 比如 10 多秒後才成功。
    之後我修改 WAN 口單播,ssh 一切正常了。
    目前可以理解爲路由器的性能在雙播情況下處理數據包不穩定導致的 ssh 失敗

原文地址:
    https://www.v2ex.com/t/412269

修改連接不執行X

#修改配置/usr/lib/deepin-terminal/ssh_login.sh
將配置
set ssh_cmd {/usr/lib/deepin-terminal/zssh -X -o ServerAliveInterval=60}
修改爲
set ssh_cmd {/usr/lib/deepin-terminal/zssh -o ServerAliveInterval=60}


### 把-X去掉,不執行頁面

調試找到錯誤點

root@kunzai:/etc/ssh# ssh -v [email protected]

1. 127.0.0.1可以改成自己服務器ip
2. 查看調試展示的信息進行相應的修改

連接成功

在這裏插入圖片描述

注意要點

1. 修改ssh_config\sshd_config時候需要重啓ssh服務
2. 修改之後可以使用root@kunzai:/etc/ssh# ssh -v [email protected](自己服務器ip)進行調試
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章