我正在尝试让 x11 转发工作从我的 mac 到 Oracle 设置的 OracleLinux7 机器。这是我收到的命令和错误:
ssh -Y user@foo.bar.com
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
Warning: No xauth data; using fake authentication data for X11 forwarding.
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_TERMINAL_VERSION = 3.3.9
debug1: Sending env LC_TERMINAL = iTerm2
debug1: Remote: X11 forwarding disabled in user configuration file.
X11 forwarding request failed on channel 0
尝试运行 xeyes 或 xclock 时
[user@foo ~]$ xeyes
Error: Can't open display:
[user@foo ~]$ echo $DISPLAY
[user@foo ~]$
以下是mac和linux盒子的配置:
OL7:/etc/sshd/sshd_config
# Use most defaults for sshd configuration.
Subsystem sftp internal-sftp
ClientAliveInterval 180
UseDNS no
UsePAM yes
PrintLastLog no # handled by PAM
PrintMotd no # handled by PAM
TrustedUserCAKeys /etc/ssh/trustedusercakeys.pem
PasswordAuthentication no
X11Forwarding yes
X11UseLocalhost yes
ChallengeResponseAuthentication no
Mac:使用 xQuartz
~/.ssh/config
Host *
ForwardX11 yes
echo $DISPLAY
/private/tmp/com.apple.launchd.HVJpmjSBkf/org.macosforge.xquartz:0
修复步骤:linux机器上的xauth +返回
[user@foo ~]$ xauth
xauth: file /home/adahlman/.Xauthority does not exist
Using authority file /home/adahlman/.Xauthority
xauth> exit
[user@foo ~]$ xauth +
xauth: file /home/user/.Xauthority does not exist
xauth: (argv):1: unknown command "+"
我尝试将各种 X11Forwarding 选项更改为 yes 和 no 但仍然没有骰子。有任何想法吗?这可能是 PAM 问题吗?