- How To Set Up And Use X11 Forwarding On Linux And Mac
- X11 Forwarding on Linux
- X11 Forwarding on Mac
- How to install X Window System XQuartz on macOS for ssh X11 forwarding
- Can’t load X11 after OS X Yosemite upgrade
- Step 1 – Download and install X Window XQuartz on macOS
- Installing X Window XQuartz on macOS using brew command
- Step 2 – Reboot your Mac
- Step 3 – ssh X11 forwarding syntax for macOS
- Step 4 – Enables and use trusted X11 forwarding
- Step 5 – Run graphical programs remotely from a Linux or BSD server on macOS
- Examples
- X11 forwarding from Linux to Mac over SSH
- Linux side configuration
- Mac configuration
- Question: Q: x11 Forwarding
- Helpful answers
- Записки океанолога — обработка и визуализация данных
- Перенаправление сеанса X11 и ssh в Mac OS X (X11 forwarding)
- No Comment
How To Set Up And Use X11 Forwarding On Linux And Mac
More experienced users know that you can connect to a Linux server quite easily using a variety of SSH (Secure Shell) clients. That’s all well and good but what about if you need to use some tool that has a GUI?
The answer is to use X11 forwarding. X11 forwarding is a mechanism that allows a user to start up remote applications but forward the application display to your local Windows machine.
X11 Forwarding on Linux
There are a few minor changes needed on your Linux box to enable X11 forwarding. In this basic example I am using a standard CentOS 6.5 installation with GNOME installed. Other Linux distributions will have a very similar SSH daemon configuration. The SSH configuration file is located at /etc/ssh/sshd_config. Locate and uncomment (or add) the following lines:
X11Forwarding yes
X11UseForwarding yes
These items allow the traffic to be forwarded over to your computer from the host and also allow forwarding to be used. X11 forwarding can be configured on a per user basis. There are additional options that can be configured for X11 forwarding, but those go beyond the scope of this introductory article. The system can also be configured to allow multiple X11 forwarded users, but each user will have to use a separate port range.
Once the config file’s modifications have been made to your Linux system, the SSH service will need to be restarted to effect the revised configuration. Restart the services by using the command:
All being well, the sshd service will be fully restarted. As a funny little test, install «xeyes.» Use the command:
It is also prudent to check that the firewall is not blocking the forwarded requests. Iptables‘ configuration may need to be adjusted if they are. To turn off Iptables on a temporary basis, you can use the command:
On the Windows guest, the first requirement is to install PuTTY, which provides the mechanism to forward the display data between the host (the Linux server) and guest (your Windows machine). If you don’t already have PuTTY, download the PuTTY application from the PuTTY website and install it. I’d suggest using the full download package.
There are many display managers you can use. In this example we are using Xming, which is free and downloadable from sourceforge.net . Download Xming to your Windows PC and run the setup. During installation, you might see a number of options; I’d suggest going with the defaults.
Once Xming is installed you are ready to try out X11 forwarding. You will need to allow the Windows firewall to be modified to allow Xming forwarding to work. This should automatically pop up and request the required access.
There are also two settings in PuTTY that need to be changed to make X11 forwarding work. Open PuTTY as normal, filling in the IP address or DNS alias name. Before clicking OK to connect to the server, go to the connection menu in PuTTY, select SSH, X11 and tick the box X11 forwarding. The xdisplay location should also be set to localhost:0, which is basically the display you are working on currently.
You can now connect to the Linux server using PuTTY. At the command line, run the command: xeyes. Hopefully a silly pair of comedy eyes will pop up that follow your cursor around the screen. To keep the terminal available for additional commands after you launch the X11 forwarded application, use an & at the end of the command to prevent tying up the terminal in question.
Now that you have seen it in action, it is perhaps time to share how it all works.
No matter which GUI you use on your Linux host, GNOME or KDE, they both have what is termed a xdisplay manager that underlies the GUI portion of the display. It is a network protocol that was designed from the outset to allow items to be forwarded to whichever destination is required.
X11 Forwarding on Mac
X11 forwarding on Mac is just as easy. Download Quartz and install it as you would any other Mac package. Quartz is another instance of display management. To start using X11 forwarding to your Mac, use the -X switch. In other words, the ssh command would look like this:
To test it just type in the command xclock or xeyes, and, as if by magic, you get a basic clock or aforementioned eyes on your desktop.
Источник
How to install X Window System XQuartz on macOS for ssh X11 forwarding
I need to tunnel X Window securely over SSH bases session so that I run X program on my remote Linux/Unix server/workstation and get back display to my Apple Macbook pro laptop. I tried the ssh -X user@server1 and ssh -Y user@server2 commands on macOS. However, I am unable to use the ssh command with X11 forwarding. How do I get X11 forwarding in macOS to run graphical apps remotely from a Linux server? How can I fix this problem on OS X and enable X11 forwarding with ssh command? Can you explain how to install X Window XQuartz server on Apple OS X Mountain Lion or Mavericks or Yosemite or macOS?
Tutorial details | |
---|---|
Difficulty level | Intermediate |
Root privileges | Yes |
Requirements | XQuartz and macOS with terminal |
Est. reading time | 6 mintues |
You need to install X Window XQuartz (X11.app) on macOS or OS X v10.8 or above to use ssh with x11 forwarding. The XQuartzproject is an open-source effort to develop a version of the X.Org X Window System that runs on macOS and OS X. This is Apple’s version of the X server. The latest version of macOS or Apple OS X Mountain Lion and Mavericks no longer ships with X11.app i.e. XQuartz server. You need to download and install the server before using ssh with X11 forwarding.
Can’t load X11 after OS X Yosemite upgrade
You need to delete / remove existing XQuartz server and reinstall it again.
Step 1 – Download and install X Window XQuartz on macOS
Visit this page and download XQuarz server for macOS. Once downloaded the XQuarz package, install the server by double clicking the package icon in your Downloads folder. Please follow the instructions on-screen to complete the installations:
Installing X Window XQuartz on macOS using brew command
Another option is to install Homebrew on macOS to use the brew package manager as follows using the Termaial app:
brew install —cask xquartz
Want to run graphical programs remotely from a Linux server? You need XQuartz on your Mac and can be installed using the brew
Step 2 – Reboot your Mac
You need to reboot the Mac to work it correctly. Otherwise, you will get various warnings or errors. Click on the Apple icon and then Restart. Another option is to type the following command using Termaial app:
sudo reboot
Step 3 – ssh X11 forwarding syntax for macOS
A tunneling protocol is a network protocol which encapsulates a payload protocol, acting as a payload protocol. Reasons to tunnel include carrying a payload over an incompatible delivery network, or to provide a secure path through an untrusted network. SSH is frequently used to tunnel insecure traffic over the Internet in a secure way. Simply type the following command to use X over ssh:
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
Step 4 – Enables and use trusted X11 forwarding
A small number of X11 GUI apps may require the use of -Y option instead of -X .
Trusted X11 forwardings are not subjected to the X11 SECURITY extension controls. From the ssh man page:
X11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the user’s X authorization database) can access the local X11 display through the forwarded connection. An attacker may then be able to perform activities such as keystroke monitoring. For this reason, X11 forwarding is subjected to X11 SECURITY extension restrictions by default. Please refer to the ssh -Y option and the ForwardX11Trusted directive in ssh_config(5) for more information.
Step 5 – Run graphical programs remotely from a Linux or BSD server on macOS
The main advantage of using xterm instead of the built-in Terminal app is that xterm works without rebooting your Mac.
XQuartz.app itself comes with xterm (Terminal). You can use that app too apart from built-in Terminal app. To run X11 Forwarding on Mac:
- Run XQuartz.app Applications.
- Then right click on the XQuartz icon in the dock and select Applications >Terminal:
- You should see a new xterm terminal windows
- Finally, use the xterm app and ssh into the Linux or BSD server:
ssh -X UserName@your-server-ip-here
OR
ssh -Y UserName@home-wan-linux.cyberciti.biz - Then type app name such as:
xeyes
Examples
In this example, I am going login to the Linux based nas01 server as a user called nixcraft using macOS Terminal app itself:
$ ssh -X nixcraft@nas01
OR
$ ssh -X nas01
You will see XQuartz server in the Dock i.e. a new XQuartz icon sits at the bottom of side of your screen as follows:
Fig.01: X11.app ( XQuartz ) loaded at the Dock
Animated gif 01: X11 Forwarding on OS X v10.8+. This demo was tested on OS X 10.9 i.e. Mavericks and Linux remote server.
/.ssh/config file and append the following line and you wouldn’t need pass the -X option to ssh command:
Источник
X11 forwarding from Linux to Mac over SSH
There comes a point where it is useful to run Linux GUI apps elsewhere every once in a while and in my case virt-manager. Thus I set about figuring out how to use X11 forwarding from Arch Linux to Mac OS X 10.9 Mavericks. This is how it’s done.
Linux side configuration
As usual, most of this information comes from the fantastic Arch wiki post here.
First you’ll need to install SSH if you havn’t already and set a root password.
Next edit a couple of config files under /etc/ssh first sshd_config
- Enable the AllowTcpForwarding
- Enable the X11Forwarding
- Set the X11DisplayOffset
- Enable the X11UseLocalhost
Next *ssh_config*note the subtle file name differences.
- Enable the ForwardX11 option in ssh_config
Then restart SSH for these changes to take effect.
We are done on the Linux side now, time to move over to your Mac.
Mac configuration
I use a program called XQuartz to do this which is available here.
Download and install it then log out and in again.
Next load up your terminal client and connect to your Linux box with an ssh command with the -X option as follows:
Once you’re in you should be able to load X based applications, in my instance I simply installed virt-manager via pacman and ran it from the command line with:
Источник
Question: Q: x11 Forwarding
One Server: OSX Server Yosemite, one Mac client, also on Yosemite.
Latest updates installed.
— I am able to connect from the client to the server by ssh.
— What I cannot do is connect with X11 forwarding.
X11 forwarding request failed on channel 0
I edited etc/sshd_config
I have done this with Linux for years. The client Mac can connect to Linux servers and use X11 forwarding.So the client Mac is basically ok.
Is it possible to use X11forwarding on an OSX Server? How to do it?
Posted on Feb 11, 2015 2:37 AM
Needed is one more line.
etc/ sshd_config
Afterwards restart the ssh service like:
launchctl unload ssh.plist
launchctl load ssh.plist
Then, open on your client X11 (Quartz) (you might need to install it)
Open a terminal in X11 (from the menu programs, terminal)
logon and type xclock to try whether it works
Posted on Feb 12, 2015 2:38 AM
Helpful answers
What about «ssh -o ForwardX11=yes -X . «?
Feb 11, 2015 8:40 AM
There’s more to the conversation
Loading page content
Page content loaded
What about «ssh -o ForwardX11=yes -X . «?
Feb 11, 2015 8:40 AM
Thanks for the suggestion.
Tried it, but it doesn’t solve it.
However, it adds another message:
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
X11 forwarding request failed on channel 0
Feb 12, 2015 2:09 AM
Needed is one more line.
etc/ sshd_config
Afterwards restart the ssh service like:
launchctl unload ssh.plist
launchctl load ssh.plist
Then, open on your client X11 (Quartz) (you might need to install it)
Open a terminal in X11 (from the menu programs, terminal)
logon and type xclock to try whether it works
Feb 12, 2015 2:38 AM
I tried the solution you suggested and disaster has struck. X11 no longer works. It starts, crashes, starts, crashes, etc. I have reinstalled XQuartz twice, and reinstalled OS X as well (plus a reinstall of X). I’m running the latest OS 10,10,3. There has to be some miserable file somewhere that should not be there. But how to find and remove it? Are there log files somewhere that I can look at? Use X all the time and not having it is a very big issue.
May 17, 2015 10:49 AM
Ah. Fix my issue be deleting the .xinitrc file. Goodness knows why this mattered. Contents seemed innocuous.
Источник
Записки океанолога — обработка и визуализация данных
Перенаправление сеанса X11 и ssh в Mac OS X (X11 forwarding)
Published by magik on 18 ноября, 2007 06:44 пп under nix, Без рубрики
Захотев открыть броузер через перенаправление X11 на Mac OS (нужно было посмотреть на статью в журнале доступ к которому есть у нашего универа), я столкнулся с трудностями. После привычного соединения:
и попытки запустить Mozilla, мне выдавали в ответ что Can’t open display и неипёт.
Следствие показало что оказывается Mac OS не имеет поддержки X Window System по умолчанию и что надобно её ставить. К счастью гемороя с этим не много — надо просто вставить диск 1 вашего дистрибутива Mac OS и произвести следующие манипуляции:
В открывшемся после загрузки диска окошке найти папочку System (возможно придётся промотать вертикальным бегунком немного вниз чтобы найти её, окошко открывается до безобразия маленькое) там нажать на Installation а уж в этой папке войти в Packages и там лежит вожделенный X11SDK.pkg который надо установить двойным кликом.
Ещё раз для умных
Всё. После этого в «Служебных программах» появится программа X11. Запускаете её, стандартно соединяетесь по ssh и наслаждаетесь JGR в онлайне, что иногда бывает гораздо приятней и удобней чем смотреть pdf файл.
Может случиться что вместо
No Comment
Give thanks you for all the great articles in 2019 like this one.
We look forward to study more of your articles this year.
Never forget electrical contacts inside the trucks
as effectively.
Hello mates, how is everything, and what you want to say concerning
this post, in my view its genuinely amazing in support of
me.
I’m impressed, I have to admit. Rarely do I
come across a blog that’s equally educative and interesting,
and without a doubt, you have hit the nail on the head.
The problem is something that not enough folks
are speaking intelligently about. Now i’m very happy I came across this during my hunt for something regarding this.
Hi there to every , since I am genuinely keen of reading this
web site’s post to be updated regularly. It consists of fastidious material.
c?c ch? em s? s? h?u . c h?ng t?
l?a ch?n v? ?o s?-mi m?u m? ho?n to?n kh?ng s?
h?u h?t ?i?u g?. t??ng ??i nhi?u ki?u ?o mang t?nh ch?t ??t ph? cao.
kh?ng ch? l? ?o bi?n ??i m? c?n c? c? c?c c?i qu?n n?a.
T? ??y c?c c? g?i s? c? r?t nhi?u
c?ch th?cph?i ?? xu?t s?c h?n. h?n th?
n?a m? c?n c? c? linh ph? ki?n c?ng kh? . c
??i kh?c. S? t? do trong c?ch k?t h?p ?? . c ??y l?n t?i ?a.
N?m 1999 ?? b?t ??u ??nh d?u s? v?ng m?nh ??y v??t b?c c?a m?ng th?i trang v?n ph?ng v? c?ng s?.
nh?c t? ??y, ph?c trang c?ng s?
?ang c? th?m nhi?u thay ??i ??ng k? t?i.
The most recent figures show that 51.4 % of all
US mobile customers use Safari to browse the world
wide web, with Google Chrome coming in second with 40.7 percent.
I’m gone to say to my little brother, that he should also pay a visit this web site on regular
basis to obtain updated from hottest gossip.
Automatic automobile wash systems make sure that the car remains
smooth as new.
Like!! I blog frequently and I really thank you for your content. The article has truly peaked my interest.
JOB; Denver CO USA — Junior — END USER COMPUTER SUPPORT TECHNICIAN — …
COMPUTER SUPPORT TECHNICIAN JUNI: … COMPUTER SUPPORT TECHNICIAN
JUNIOR POSITION OVERVIEW Under limited supervision provides technical
support for the in JOBS WORK TECH https://sharkacomputers.com/
Please browse our site for a run-down of our IT services or contact us today for
a free estimate. Please do not contact me to offer any web
site design, net optimisation, Seo, or some other related services.
See illustration at top right of this web web page.
What you are promoting can be at risk if you
don’t use the correct ideas to resolve the
technical problems related to your online business.
From being surrounded by the comforts of house to a extra relaxed environment compared to
a drab company location, each workers and business owners alike are opting to telecommute with rising
frequency. For all the advantages nevertheless, typically occasions working from house means sacrificing the enterprise stage IT support which a company gives.
Working from your house office supplies rather a lot of advantages.
As well as, the advantages of dwell assist website software program should not restricted to overall
improvement in conversion charge however the applications also assist in the quick conversions which
may really boost your gross sales quantity and
assist your business grow. http://ezproxy.lib.usf.edu/login?url=http://computersupportaddison.com
This is really attention-grabbing, You are an excessively professional
blogger. I have joined your feed and sit up for looking for more
of your wonderful post. Also, I’ve shared your website in my social
networks
Also visit my web-site Hydraulic Dampers
Wow that was strange. I just wrote an extremely long comment but after I clicked submit
my comment didn’t show up. Grrrr… well I’m not writing all that over again. Anyways, just wanted to say wonderful blog!
May I simply say what a relief to find somebody that actually knows what they are discussing on the internet.
You actually know how to bring an issue to light and make
it important. More and more people have to check this out and understand this side of the story.
It’s surprising you’re not more popular because you most certainly possess the gift.
1. Pick out a game that you simply want to play.
Источник