SSH login display the XWindow

本文介绍了如何在Mac上修复SSH连接时遇到的'无法打开显示'问题。首先,确保安装了XQuartz,然后通过XQuartz打开终端并使用ssh命令进行连接。如果问题依然存在,可以尝试使用xhost+禁用访问控制,或者在ssh命令中添加-X或-Y选项来启用X11转发。此外,设置DISPLAY环境变量也可能有助于解决问题。
摘要由CSDN通过智能技术生成

Step1: For those having similar issues on OS X, also make sure you have XQuartz installed,

Step2: Open terminal application from XQuartz

Step3: In the terminal, ssh -Y username@hostname

Then it should work.

 

Below are other options but do not work for me on MAC.

 

Answer: You can fix the “cannot open display” error by following the xhost procedure mentioned in this article.

Allow clients to connect from any host using xhost+

Execute the following command to disable the access control, by which you can allow clients to connect from any host.

$ xhost +

access control disabled, clients can connect from any host

Enable X11 forwarding

While doing ssh use the option -X to enable X11 forwarding.

$ ssh username@hostname -X

Enable trusted X11 forwarding, by using the -Y option,

$ ssh username@hostname -Y

Open GUI applications in that host

After opening ssh connection to the remote host as explained above, you can open any GUI application which will open it without any issue.

If you still get the “cannot open display” error, set the DISPLAY variable as shown below. 

$ export DISPLAY='IP:0.0'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值