AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 35512
Accepted
Martin Ueding
Martin Ueding
Asked: 2011-04-17 11:42:45 +0800 CST2011-04-17 11:42:45 +0800 CST 2011-04-17 11:42:45 +0800 CST

`ssh -Y`(受信任的 X11 转发)和`ssh -X`(不受信任的 X11 转发)有什么区别?

  • 772

ssh -Y(受信任的 X11 转发)和(不受信任的 X11 转发)有什么区别ssh -X?据我了解,它与安全有关,但我没有掌握区别以及何时使用哪个。

xorg
  • 4 4 个回答
  • 119753 Views

4 个回答

  • Voted
  1. Best Answer
    qbi
    2011-04-17T12:38:55+08:002011-04-17T12:38:55+08:00

    这两个选项都与 X11 转发有关。这意味着如果您启用它,您可以通过 SSH 会话使用图形客户端(例如,使用 Firefox 或其他)。

    如果您使用ssh -X remotemachine远程机器被视为不受信任的客户端。因此,您的本地客户端向远程机器发送命令并接收图形输出。如果您的命令违反了某些安全设置,您将收到错误消息。

    但是如果你使用ssh -Y remotemachine远程机器被视为一个受信任的客户端。最后一个选项可能会引发安全问题。因为其他图形(X11)客户端可以从远程机器上嗅探数据(制作屏幕截图、做键盘记录和其他讨厌的东西),甚至可以更改这些数据。

    如果您想了解更多关于这些内容的信息,我建议您阅读Xsecurity 手册页或X 安全扩展规范。此外,您可以检查选项ForwardX11并ForwardX11Trusted在您的/etc/ssh/ssh_config.

    • 120
  2. Mitchell
    2016-03-31T08:08:43+08:002016-03-31T08:08:43+08:00

    当您不需要远程运行 X11 程序时,两者都不使用;使用-X时使用;-Y如果您关心的 X11 程序使用 -Y 比使用 -X 效果更好,则假设使用。但目前(Ubuntu 15.10),-X 与 -Y 相同,除非您编辑ssh_config为ForwardX11Trusted no. -X 最初是为了启用 1990 年代的 X 安全扩展,但它陈旧且不灵活,并且会使某些程序崩溃,因此默认情况下会被忽略。

    ssh-Y和-X让您在远程机器上运行 X11 程序,其窗口出现在本地 X 监视器上。问题是允许程序对其他程序的窗口和 X 服务器本身做什么。

    local$ ssh -X remote
    remote$ xlogo
    # Runs xlogo on remote, but the logo pops up on the local screen.
    

    受信任的 X11 转发由 启用-Y。这是历史行为。可以访问显示器的程序被信任可以访问整个显示器。它可以截屏、键盘记录并将输入注入其他程序的所有窗口。它可以使用所有 X 服务器扩展,包括像加速图形这样的安全漏洞。这有利于平稳运行,但不利于安全。您相信远程程序与本地程序一样安全。

    不受信任的 X11 转发试图限制远程程序只能访问它们自己的窗口,并且只使用 X 中相对安全的那些部分。这听起来不错,但目前在实践中效果不佳。

    current 的含义-X取决于你的 ssh 配置。

    在 Ubuntu 14.04 LTS 上,除非您编辑ssh_config.-X和-Y. “[B] 因为目前有太多程序在 [untrusted] 模式下崩溃。”

    ubuntu1404$ man ssh
    ...
     -X      Enables X11 forwarding.  This can also be specified on a per-host
             basis in a configuration file.
             ...
             (Debian-specific: X11 forwarding is not subjected to X11 SECURITY
             extension restrictions by default, because too many programs cur‐
             rently crash in this mode.  Set the ForwardX11Trusted option to
             “no” to restore the upstream behavior.  This may change in
             future depending on client-side improvements.)
    
    ubuntu1404$ grep ForwardX11Trusted /etc/ssh/ssh_config
    #   ForwardX11Trusted yes
    

    如果ForwardX11Trusted no,则-X启用不受信任的转发。否则,-X被视为与 相同-Y,相信具有显示访问权限的远程程序是友好的。

    • 36
  3. Ortomala Lokni
    2016-01-10T17:57:55+08:002016-01-10T17:57:55+08:00

    该-X选项启用 X11 转发:

    -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.
    

    与 ssh_config(5) 中的 ForwardX11Trusted 指令相对应的选项-Y更不安全,因为它删除了 X11 SECURITY 扩展控制。

    -Y      Enables trusted X11 forwarding.  Trusted X11 forwardings are not
            subjected to the X11 SECURITY extension controls.
    

    使用起来更安全-x

    -x   Disables X11 forwarding.
    
    • 2
  4. Good Pen
    2022-01-27T08:04:23+08:002022-01-27T08:04:23+08:00

    来自男人:

    Debian 特定:
    在默认配置中: ForwardX11Trusted yes

    -Y 等价于 -X (我认为这个描述更好:-X 和 -Y 一样易于使用,但风险相同)


    不受信任并不意味着机器比受信任的机器更危险,而是意味着你很谨慎,所以更安全。

    • -1

相关问题

  • 如何从命令行重新启动 X Window Server?

  • xorg 中是否有用于更改视频驱动程序的 GUI?

  • 类似于 Eyefinity 的东西?

  • 如何重置我的键盘布局?

  • 帮助让 Flash 播放器在第二个屏幕上工作?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    我需要什么命令来解压缩/提取 .tar.gz 文件?

    • 8 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Marko Smith

    如何使用命令行将用户添加为新的 sudoer?

    • 7 个回答
  • Marko Smith

    更改文件夹权限和所有权

    • 9 个回答
  • Martin Hope
    EmmyS 我需要什么命令来解压缩/提取 .tar.gz 文件? 2011-02-09 14:50:41 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve