您的位置:首页 > 其它

How to install and config X11 on Mac

2015-09-19 09:36 507 查看
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.

Launch the Terminal application (found in your Utilities folder).
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.

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


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


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.

grep X11Forwarding /etc/sshd_config

Connecting To Remote Servers

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

Open X11 in your Utilities folder. A window that looks deceptively like the Terminal will open.
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].
Type
exit
in the xterm window when you are done. This will disconnect you from the remote server.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: