Kubernetes 通过ssh在远程计算机中启动minikube仪表板
我在一台远程计算机上安装了minikube。服务已启动,配置看起来正常:Kubernetes 通过ssh在远程计算机中启动minikube仪表板,kubernetes,ssh,minikube,Kubernetes,Ssh,Minikube,我在一台远程计算机上安装了minikube。服务已启动,配置看起来正常: $ kubectl cluster-info Kubernetes master is running at https://192.168.49.2:8443 KubeDNS is running at https://192.168.49.2:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy To further debug and diag
$ kubectl cluster-info
Kubernetes master is running at https://192.168.49.2:8443
KubeDNS is running at https://192.168.49.2:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
我通过SSH连接到这台计算机,能够启动所有图形应用程序。健全性检查,确认允许X11转发:
$ grep X11Forwarding /etc/ssh/sshd_config
X11Forwarding yes
但当我尝试启动仪表板时,出现X11错误:
$ minikube dashboard
* Verifying dashboard health ...
* Launching proxy ...
* Verifying proxy health ...
* Opening http://127.0.0.1:39571/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser...
X11 connection rejected because of wrong authentication.
[61559:61559:1119/114641.640444:ERROR:browser_main_loop.cc(1434)] Unable to open X display.
原因可能是什么
更新:答复时,SSH客户端上的ForwardX11Trusted
参数设置为yes
:
$ cat /etc/ssh/ssh_config | grep ForwardX11Trusted
ForwardX11Trusted yes
这可能有很多原因。您可能只需要:
export XAUTHORITY=$HOME/.Xauthority
还要确保~/.Xauthority
为您所有
要对其进行验证,请运行:
ls -l ~/.Xauthority
然后,根据结果,您可能需要通过以下方式修复该文件的所有权和权限:
chown user:group ~/.Xauthority
及
如果在ssh客户端配置中设置了
ForwardX11Trusted
,该怎么办?在客户端中设置了@larksForwardX11Trusted
。我正在更新这个问题,可能有很多原因。您可能需要导出XAUTHORITY=$HOME/.XAUTHORITY。还要确保~/.Xauthority
为您所有。运行ls-l~/.Xauthority
来验证它。您可能需要使用chown user:group~/.Xauthority
和chmod 0600~/.Xauthority
@mario修复该文件上的权限。设置Xauthority
变量后,它就开始工作了。你能添加你的评论作为答案吗?@Luís de Sousa,当然,刚刚添加了我的答案。我很高兴这有帮助。:)
chmod 0600 ~/.Xauthority