我正在尝试使用以下方法启动远程 gnome 会话: ssh -X username@192.168.1.107 gnome-session
客户端和服务器都是 Ubuntu 12.04 版
我得到以下信息(发生的并不多)...
GNOME_KEYRING_CONTROL=/tmp/keyring-3aeNAh
GPG_AGENT_INFO=/tmp/keyring-3aeNAh/gpg:0:1
GNOME_KEYRING_PID=3573
GNOME_KEYRING_CONTROL=/tmp/keyring-3aeNAh
GPG_AGENT_INFO=/tmp/keyring-3aeNAh/gpg:0:1
GNOME_KEYRING_CONTROL=/tmp/keyring-3aeNAh
GPG_AGENT_INFO=/tmp/keyring-3aeNAh/gpg:0:1
SSH_AUTH_SOCK=/tmp/keyring-3aeNAh/ssh
GNOME_KEYRING_CONTROL=/tmp/keyring-3aeNAh
GPG_AGENT_INFO=/tmp/keyring-3aeNAh/gpg:0:1
SSH_AUTH_SOCK=/tmp/keyring-3aeNAh/ssh
(gnome-settings-daemon:3572): color-plugin-WARNING **: failed to get contents of /sys/class/dmi/id/board_version: Failed to open file '/sys/class/dmi/id/board_version': No such file or directory
** (gnome-settings-daemon:3572): WARNING **: You can only run one xsettings manager at a time; exiting
** (gnome-settings-daemon:3572): WARNING **: Unable to start xsettings manager: Could not initialize xsettings manager.
compiz (core) - Error: Screen 0 on display "localhost:10.0" already has a window manager; try using the --replace option to replace the current window manager.
Initializing nautilus-gdu extension
Created new window in existing browser session.
** Message: applet now removed from the notification area
** Message: using fallback from indicator to GtkStatusIcon
(gnome-settings-daemon:3572): keyboard-plugin-WARNING **: Failed to set the keyboard layouts: GDBus.Error:org.freedesktop.Accounts.Error.PermissionDenied: Not authorized
** (gnome-settings-daemon:3572): WARNING **: Failed to connect context: Connection refused
(gnome-settings-daemon:3572): clipboard-plugin-WARNING **: Clipboard manager is already running.
(gnome-settings-daemon:3572): color-plugin-WARNING **: failed to create device: GDBus.Error:org.freedesktop.ColorManager.Failed: failed to obtain org.freedesktop.color-manager.create-device auth
(gnome-settings-daemon:3572): color-plugin-WARNING **: GDBus.Error:org.freedesktop.ColorManager.Failed: failed to obtain org.freedesktop.color-manager.create-profile auth
(gnome-settings-daemon:3572): color-plugin-WARNING **: no xrandr-Samsung Electric Company-SAMSUNG device found: Failed to find output xrandr-Samsung Electric Company-SAMSUNG
Shutting down nautilus-gdu extension
** (gnome-settings-daemon:3572): WARNING **: Failed to connect context: Connection refused
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
Run Code Online (Sandbox Code Playgroud)
Sta*_*mer 12
我假设您要做的是启动一个完整的远程 Gnome 会话,显示在您的本地机器上。这将失败,因为您已经有一个本地会话管理器控制您的 X 服务器显示。
您的选择是:
只需使用启动单个远程应用程序 ssh -X user@192.168.1.107 xclock
假设在远程机器上启用了 XDMCP...
2a. 用于Xnest -query 192.168.1.107 -geometry 1024x768 :1在本地窗口中启动远程登录会话。
2b. 使用Xephyr :1 -screen 1024x768 -query 192.168.1.107比 X 服务器更好的 X 服务器Xnest
同样假设远程机器上有 XDMCP,配置你的本地机器在启动时使用 XDMCP 选择器而不是标准的欢迎程序。
启用 XDMCP 只是将
[xdmcp]
Enable=true
Run Code Online (Sandbox Code Playgroud)
在/etc/gdm/custom.conf并重新启动gdm或重新启动(假设您正在运行gdm)。
如果您只想远程运行一些应用程序,那么选项 1 是最简单的,并且会继续使用 SSH 加密流量,而其他人都没有这样做(因此它们最好只在受信任的本地网络上使用)。
如果您需要更复杂的东西,那么 2b (Xephyr) 可能会更好,但我通常发现仅ssh -X ... &用于多个远程应用程序就足够了。
如果您正在远程执行所有操作,即本地计算机只是一个显示服务器并且本身不执行任何操作,那么您需要考虑使用选项 3,启动 XDMCP 选择器而不是标准登录。
PS:正如在评论中指出,无论是Xnest和Xephyr是其处理的X服务器协议的应用程序,并把整个会话到一个窗口。Xnest使用本地 X 服务器提供的功能,同时Xephyr处理更多的服务器协议本身,因此更加健壮。默认情况下可能不会安装它们,因为普通用户不会使用它们。
PPS:经过深思熟虑,很明显如何加密一个Xephyr或Xnest会话......
ssh -X username@192.168.1.107 Xephyr :1 -query localhost -screen 1280x1024
Run Code Online (Sandbox Code Playgroud)