archlinux 打开x11转发

arch

arch 的一个家庭server上启用 x11 转发 方便应急的情况下用浏览器备份文件到网页端网盘

本文基于 Linux archlinux 6.1.1-zen1-1-zen

plaintext
sudo pacman  -S xorg-xauth
sudo nano /etc/ssh/sshd_config 

sshd_config

plaintext
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

重启sshd 重新链接 ok了

plaintext
sudo systemctl restart sshd

------ 下面内容作废 --------------------
修改 sshd_config

plaintext
sudo nano /etc/ssh/sshd_config 
----下面几行取消#注释---
#AllowAgentForwarding yes  #非必须
#AllowTcpForwarding yes  #非必须

#X11Forwarding no #取消注释并改为yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#AddressFamily any # 这项下面添加一行  AddressFamily inet

重启ssh后 发现无效 查询wiki后发现需要 xorg-xauth
安装xorg-xauth

plaintext
sudo pacman  -S xorg-xauth

配置

plaintext
touch ~/.Xauthority && chmod 600 ~/.Xauthority

重启sshd

plaintext
sudo systemctl restart sshd

重新链接 ok了

参考 https://wiki.archlinuxcn.org/wiki/OpenSSH#X11_forwarding

评论