Mac OS X ssh to Linux using gnuplot

Source: Internet
Author: User
Tags sin

Use a terminal under OS X, such as Iterm,ssh to a Linux machine, and then use Gnuplot on a Linux machine to draw.

First, the project configuration

I'm using OS X Yosemite 10.10, going to ssh RedHat Linux, and these are all done under these prerequisites.

1. Mac OS X System installation x11. When you use the OS X system search function (Control+space) to try to find X11, will be prompted to install X11, choose to continue, will be taken to the online store, download xquartz-2.7.7.dmg This file, download complete installation. X11 is now no longer integrated in OS X, so we need to install it. No configuration is required for X11 after installation and no configuration is required for OS X systems.

2. Linux system open x fowarding function

2.1 sudo vi/etc/ssh/sshd_config for the following settings:

x11forwarding Yes

X11uselocalhost No

Without such a setting, you may be prompted when you log in:X11 forwarding request failed on Channel 0

2.2 Then restart the SSH service

Sudo/etc/init.d/sshd Reload

Get the following output hint

Reloading sshd: [OK]

3. Log in to the Linux system from OS X, you can use the system terminal or ITERM, etc.

ssh-x [email protected]

The X11 installed on OS X system will be automatically adjusted

4. Under the SSH Terminal Login window you can work under the Linux system, type the command

Gnuplot

You will see a hint like this: Terminal type set to ' X11 '

(Always get this prompt before the configuration succeeds, gnuplot:unable to open display ': 0.0 ' gnuplot:x11 aborted.)

Try the command plot sin (x), and OS X will appear with a new window with a sinusoidal curve above it.

5. Say more, in order to be more convenient, later you can also execute gnuplot-persist-e "plot sin (x) under the shell ..."

6. You may not have x authority installed under your Linux system, please install sudo yum installed Xauth

Second, some search keywords

1. Maybe your machine environment and the machine environment I use are not consistent, maybe you have installed more or less installed, I am not sure of these. Following the actions given above, it is inevitable that problems will occur. There is a problem or to solve, here are some search terms, the proposed use of Google, the information on Baidu is still difficult to search:

Tunnel x over SSH from OS X Unix terminal to login Far_away_machine (a Linux server)

SSH x11-forwarding sshd_config file "Xorg-x11-xauth " package Export display=:0.0 DISPLAY environment Variables set-up X11 Forwarding over ssh x-server X Window System

2. There are some good blog materials, with this information as the portal, you can quickly retrieve more information, so that you do not bother to find them:

http://www.cyberciti.biz/faq/how-to-fix-x11-forwarding-request-failed-on-channel-0/

http://www.wenzk.com/archives/888

http://dyhr.com/2009/09/05/how-to-enable-x11-forwarding-with-ssh-on-mac-os-x-leopard/

Http://www.linuxidc.com/Linux/2013-06/86743.htm (This is in the explanation principle + practice, although is the Windows edition, but is worth the reference)

Http://www.360doc.com/content/10/0519/15/1242710_28400112.shtml

Http://www.seas.upenn.edu/cets/answers/x11-forwarding.html

Https://kb.iu.edu/d/bdnt

http://www.cyberciti.biz/faq/apple-osx-mountain-lion-mavericks-install-xquartz-server/(seemingly a document from the Apple community)

Three, the principle

Here are some of my own ideas about the principle:

Mac OS X ssh to Linux using gnuplot

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.