How to install and config X11 on Mac

First go to https://xquartz.macosforge.org/trac to get the release version of X11. After you finish the installment, you should do the following steps to config your X11 on your Mac.

  1. Launch the Terminal application (found in your Utilities folder).
  2. Start by making a copy of the /etc/sshd_config file which is the configuration file for the SSH daemon.
    sudo cp /etc/sshd_config sshd_config.orig

    The sudo command will allow you to execute the cp (copy) command with root permissions giving you full read/write access to the filesystem. You will need an administrator password. Enter it when prompted.

  3. Edit the original file we just made a backup copy of using your preferred text editor. Be sure to use a plain text editor such as BBEdit, pico or vi in order to preserve the integrity of the file. In this case, using pico.
    sudo vi /etc/sshd_config
  4. The contents of the sshd_config file should now be visible in your Terminal window. Locate that line that reads #X11Forwarding no and change it to remove the octothorp character at the beginning of the line to activate it. We also need to change the line to replace no with yes.

    The final line should look like: X11Forwarding yes

  5. You can check if the step 4 with the command:
     grep X11Forwarding /etc/sshd_config
          make sure you have seen this:X11Forwarding yes in your termal.
  1. grep X11Forwarding /etc/sshd_config
  2. Connecting To Remote Servers

    Now that we have X11 configured, if you have a second computer available you can test a remote connection.

    1. Open X11 in your Utilities folder. A window that looks deceptively like the Terminal will open.
    2. In the new xterm window, use the following command to remotely login to a second computer (Mac OS X, Linux or other *nix): ssh -X [USERNAME]@[IPADDRESS].
    3. Type exit in the xterm window when you are done. This will disconnect you from the remote server.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值