当前位置:网站首页>X11 forwarding
X11 forwarding
2022-07-17 05:20:00 【阿卡基YUAN】
-X Enables X11 forwarding. This can also be specified on a per-host basis in a configuration file.
X11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the user's X authorization database) can access the local X11 display
through the forwarded connection. An attacker may then be able to perform activities such as keystroke monitoring.For this reason, X11 forwarding is subjected to X11 SECURITY extension restrictions by default. Please refer to the ssh -Y option and the ForwardX11Trusted directive in ssh_config(5) for more
information.(Debian-specific: X11 forwarding is not subjected to X11 SECURITY extension restrictions by default, because too many programs currently crash in this mode. Set the ForwardX11Trusted option
to “no” to restore the upstream behaviour. This may change in future depending on client-side improvements.)-x Disables X11 forwarding.
-Y Enables trusted X11 forwarding. Trusted X11 forwardings are not subjected to the X11 SECURITY extension controls.
(Debian-specific: This option does nothing in the default configuration: it is equivalent to “ForwardX11Trusted yes”, which is the default as described above. Set the ForwardX11Trusted option
to “no” to restore the upstream behaviour. This may change in future depending on client-side improvements.)
X11 forwarding is a mechanism that allows graphical interfaces of X11 programs running on a remote system to be displayed on a local client machine.
For X11 forwarding the remote host does not need to have a full X11 system installed, however it needs at least to have xauth installed. xauth is a utility that maintains Xauthority configurations used by server and client for authentication of X11 session (source).
Warning: X11 forwarding has important security implications which should be at least acknowledged by reading relevant sections of ssh(1), sshd_config(5), and ssh_config(5) manual pages. See also this StackExchange question.
Setup
Remote
- install the xorg-xauth and xorg-xhost packages
- in
/etc/ssh/sshd_config:- set
X11Forwardingto yes - verify that
AllowTcpForwardingandX11UseLocalhostoptions are set to yes, and thatX11DisplayOffsetis set to 10 (those are the default values if nothing has been changed, see sshd_config(5))
- set
- then restart the sshd daemon.
Client
- install the xorg-xauth package
- enable the
ForwardX11option by either specifying the-Xswitch on the command line for opportunistic connections, or by settingForwardX11to yes in the client's configuration.
Tip: You can enable the ForwardX11Trusted option (-Y switch on the command line) if GUI is drawing badly or you receive errors; this will prevent X11 forwardings from being subjected to the X11 SECURITY extension controls. Be sure you have read the warning at the beginning of this section if you do so.
Usage
The factual accuracy of this article or section is disputed.
Reason: xhost is generally not needed (Discuss in Talk:OpenSSH#X11 forwarding)
Log on to the remote machine normally, specifying the -X switch if ForwardX11 was not enabled in the client's configuration file:
$ ssh -X [email protected]
If you receive errors trying to run graphical applications, try ForwardX11Trusted instead:
$ ssh -Y [email protected]
You can now start any X program on the remote server, the output will be forwarded to your local session:
$ xclock
If you get "Cannot open display" errors try the following command as the non root user:
$ xhost +
The above command will allow anybody to forward X11 applications. To restrict forwarding to a particular host type:
$ xhost +hostname
where hostname is the name of the particular host you want to forward to. See xhost(1) for more details.
Be careful with some applications as they check for a running instance on the local machine. Firefox is an example: either close the running Firefox instance or use the following start parameter to start a remote instance on the local machine:
$ firefox --no-remote
If you get "X11 forwarding request failed on channel 0" when you connect (and the server /var/log/errors.log shows "Failed to allocate internet-domain X11 display socket"), make sure package xorg-xauth is installed. If its installation is not working, try to either:
- enable the
AddressFamily anyoption insshd_configon the server, or - set the
AddressFamilyoption insshd_configon the server to inet.
Setting it to inet may fix problems with Ubuntu clients on IPv4.
For running X applications as other user on the SSH server you need to xauth add the authentication line taken from xauth list of the SSH logged in user.
Tip: Here are some useful links for troubleshooting X11 Forwarding issues.
边栏推荐
- 过拟合原因及解决办法
- [force buckle] the same tree
- 基于视觉显著性的外观注视估计
- Part of the second Shanxi Network Security Skills Competition (Enterprise Group) WP (III)
- Perception de l’état d’attention des utilisateurs sur les smartphones
- 網絡中的一些基本概念
- Bottom up and top-down attention: different processes and overlapping nervous systems 2014sci
- 山西省第二届网络安全技能大赛(企业组)部分赛题WP(一)
- oracle中merge into 与update的性能对比
- Experiment class II and object definition initialization
猜你喜欢
![[force buckle] copy the linked list with random pointer](/img/ed/eb54aad302da3aaac7e1d583770ca0.png)
[force buckle] copy the linked list with random pointer

Learning video saliency from human gaze using candidate selection

视图、索引文件的应用

用头部运动学习无姿态注视偏差

Interview review nth time

基于视觉显著性的外观注视估计

wireshark抓包:错误分析

Using VOR depth estimation to solve the problem of target ambiguity in three-dimensional gaze interaction

二分查找及其引申

吴恩达机器学习第10-11章
随机推荐
[force buckle] symmetric binary tree
吴恩达机器学习第6-7章
Leetcode string
Hand in hand building a home NAS universal server (1) | configuration selection and preparation
Introduction to daily use of manjaro system
Busybox specified date modification temporarily does not require clock -w to write to hardware
Es aggregation analysis reports an error: "reason": "text fields are not optimized for operations
Interview review nth time
锁
人脸识别错误
《PyTorch深度学习实践》-B站 刘二大人-day6
读取图片 进行空间转换 展现不同颜色空间
Sword finger offer brush questions
Part of the second Shanxi Network Security Skills Competition (Enterprise Group) WP (II)
mass data
Preparation of blast Library of rust language from scratch (1) -- Introduction to the basics of blas
二分查找及其引申
Learning non posture gaze deviation with head movement
感知智能手機上用戶的關注狀態
日常的眼睛接触检测使用无监督的注视目标发现