LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-07-2007, 11:59 PM   #1
BlueTornJacket
LQ Newbie
 
Registered: Jan 2007
Distribution: Ubuntu 5.10 Breezy, Fedora Core 6, Mac OS X 10.4.8
Posts: 16

Rep: Reputation: 0
X11 Forwarding


Probably a basic question, but what command should I be using to connect to an X11 server listening on port 6000?

Just the basic command, exclude ssh forwarding, xdmcp etc.

Any links where I could read more on this would be greatly helpful.
 
Old 03-08-2007, 08:20 AM   #2
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
Quote:
Originally Posted by BlueTornJacket
what command should I be using to connect to an X11 server listening on port 6000?
You gotta tell us more. Too much is left to guessing. It depends on what you want to happen. If, e.g., you wanted a clock to show up, the command would be "xclock", e.g., "xclock -display server:0"

Again, please tell us what you're trying to achieve.
 
Old 03-08-2007, 08:25 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Yes, display option or DISPLAY environment variable.
xterm -display :1
DISPLAY=:1 xterm

The link will not be tunneled in ssh so it's unencrypted.

If the X server does security, setting the good cookie should be enough.
As root for example:
xauth merge ~user_that_started_X/.Xauthority
then root has the security cookie of user_that_started_X and is allowed to connect to X.

Last edited by nx5000; 03-08-2007 at 08:26 AM.
 
Old 03-08-2007, 07:30 PM   #4
BlueTornJacket
LQ Newbie
 
Registered: Jan 2007
Distribution: Ubuntu 5.10 Breezy, Fedora Core 6, Mac OS X 10.4.8
Posts: 16

Original Poster
Rep: Reputation: 0
I have two units currently networked together, both running X11. The target unit is using Red Hat Linux Shrike and Xfce. The local unit is running windows cygwin/x.

If the Red Hat box has x11 listening on port 6000, then what command should I be entering on the windows machine in order to spawn an xterm running on the Red Hat machine, but displayed on my windows x11?

x11 on cygwin/x (windows) is standard, doesn't seem any different than my macosx or other linux/unix x windows.
 
Old 03-08-2007, 07:57 PM   #5
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
Originally Posted by BlueTornJacket
I have two units currently networked together, both running X11. The target unit is using Red Hat Linux Shrike and Xfce. The local unit is running windows cygwin/x.

If the Red Hat box has x11 listening on port 6000,
The Xserver is where your monitor,keyboard and mouse are. The X server and xfce won't be used if you want to display locally then.
Quote:
then what command should I be entering on the windows machine in order to spawn an xterm running on the Red Hat machine, but displayed on my windows x11?
ssh is a way to connect to your redhat. It also allows you to do X11 tunneling in ssh.
From cygwin, start your xserver and run
ssh -X user@shrike
xterm

If everything is well configured, you should see the xterm on your cygwin
 
Old 03-08-2007, 10:30 PM   #6
BlueTornJacket
LQ Newbie
 
Registered: Jan 2007
Distribution: Ubuntu 5.10 Breezy, Fedora Core 6, Mac OS X 10.4.8
Posts: 16

Original Poster
Rep: Reputation: 0
What if I have SSH, Telnet, Rlogin etc all disabled on the Red Hat machine?

I'm a little familiar with ssh -Y and -X options, but I'm curious then if ssh is the standard for using X11 forwarding, then why does the Red Hat machine have X11 listening on port 6000 at all then?
 
Old 03-09-2007, 05:52 AM   #7
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
Originally Posted by BlueTornJacket
What if I have SSH, Telnet, Rlogin etc all disabled on the Red Hat machine?
Simple.. remotely, you can't execute any command on the RH.
Quote:
I'm a little familiar with ssh -Y and -X options, but I'm curious then if ssh is the standard for using X11 forwarding, then why does the Red Hat machine have X11 listening on port 6000 at all then?
Look at this

In your case, the X client is xterm, and it connects through the network to the X server (which is the machine hosting the screen,keyboard,.. hardware resources, in your case your local machine)

Compared to windows, linux comes with 2 layers that can be seperated. The client can connect to another server. On windows, roughly speaking, when you start a GUI, it displays locally. On linux, when you start a GUI (an X client), it can be displayed on another monitor (X server).
The X server on RH is used for displaying on the RH monitor.

For your scenario, you can connect remotely to RH , stop the xserver (like telinit 3 as root), this will stop any graphic display on the RH.
Then start an X client specifying an other X server DISPLAY. Via the X11 network-protocol, it will displaw on the X server.

So you only need to open the X server (6000+x) and the client has to connect to it. The x11 network-protocol is not encrypted and commands can be injected by an attacker or snooping is very easy ( a few lines is enough)
One way of securing it is to put the X11 protocol in the same connection as the one ssh uses. It's a trick of redirecting sockets and the concept of tunnel.

But you can also connect with SSH (without the -X and -Y) and set manually the DISPLAY environment variable. Then your xterm on RH will connect to local:6000 without passing trhough the tunnel.
There is no advantage of doing this..

http://en.wikipedia.org/wiki/X_Window_System
The Xwindow is an amazing piece of software, one of the reason I got addicted to linux environments.

Hope it's clear..

Last edited by nx5000; 03-09-2007 at 05:54 AM.
 
Old 03-09-2007, 11:04 AM   #8
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
Nx5000 is absolutely correct. Listen to him/her!

To summarize your situation,
Quote:
I have two units currently networked together, both running X11. The target unit is using Red Hat Linux Shrike and Xfce. The local unit is running windows cygwin/x.
[and you want] to spawn an xterm running on the Red Hat machine, but displayed on my windows x11?
That makes your Windows box the X server. The X client, xterm, will run on the RedHat machine. It doesn't matter at all whether the RedHat has an X11 running, or if it's listening on any port. Assuming the windows box is listening on :6000, you need to execute a command like "xterm -display windowshost:0" on the Red Hat machine. Ssh is one way to achieve that from the windows box. (Rsh, rlogin and telnet are too, but they're insecure and it's a good idea to disable them.)

Quote:
What if I have SSH, Telnet, Rlogin etc all disabled on the Red Hat machine?
That makes it impossible to achieve your goal.

I understand you don't want to use ssh, but IMO it would be the easiest let it tunnel X11 -- ssh sets DISPLAY for you and handles authentication, so you don't have to deal with the magic cookie issue either.

What have you tried so far? What results (e.g., error messages) did you get?
 
Old 03-09-2007, 07:37 PM   #9
BlueTornJacket
LQ Newbie
 
Registered: Jan 2007
Distribution: Ubuntu 5.10 Breezy, Fedora Core 6, Mac OS X 10.4.8
Posts: 16

Original Poster
Rep: Reputation: 0
I can successfully display the xclient (RH) on the xserver (windows) using SSH no problem.

I was basically just curious if there was a way to connect to the RH box through the open port for x11.

You see, I was logged into my RH box using SSH and playing with the sshd_config and added "MaxAuthTries $value" and then restarted the machine, and got an error on boot that the ssh server could not be started because of the invalid option of maxauthtries.

At this point I figured, no problem, I'll just ssh in and change the sshd_config back and then update it to the latest version of ssh etc. Unfortunately, this is the only remote access service I have on the RH box thats even running, yet alone allowed access through the firewall.

The next step would be to stop being lazy and actually physically connect a keyboard and mouse to this machine except I don't have the original keyboard/mouse I used to install RH and I gave away the last PS/2 connection keyboard/mouse I had. For some reason RH shrike doesn't seem to be autodetecting any of USB keyboards/mice.

Since X11 port 6000 seems to completely different than I originally imagined then, I guess I'll just DL the most hardware compatible live cd I can find and try editing the config file on the RH partition directly.

Thanks for all the feedback and time though everyone. Greatly appreciated.
 
Old 03-09-2007, 08:09 PM   #10
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
Ouch!

Nope, port 6000 isn't supposed to be a way in. It would allow remote x-clients to display their graphics on the screen of the RH box. Sorry.

BTW, your approach with a live CD makes sense.
 
Old 03-11-2007, 01:43 AM   #11
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
I hope your boot order is set to check the DVD/cd first. If it is not, how are you going to change the bios settings? Most motherboards I use will not let you use a usb keyboard alter bios settings. This is a pretty handy safety thing for public computers.

Lazlow
 
Old 03-12-2007, 05:00 PM   #12
BlueTornJacket
LQ Newbie
 
Registered: Jan 2007
Distribution: Ubuntu 5.10 Breezy, Fedora Core 6, Mac OS X 10.4.8
Posts: 16

Original Poster
Rep: Reputation: 0
Yeah I always set DVD/CDROM to first boot order. I actually just resolved this issue btw so I'm all good to go again. Thanks for the concern.

In case anyway is curious I used a ubuntu live CD which detected all my hardware no problem.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
X11 forwarding BigNate Linux - Software 16 06-21-2011 01:39 AM
X11 forwarding paul_mat Linux - Newbie 3 12-12-2004 06:30 PM
X11 forwarding JanDeMan Mandriva 1 04-17-2004 09:02 PM
Need Help with X11 forwarding phatboyz Linux - General 3 04-16-2004 03:17 PM
forwarding x11 via thru a firewall fddi1 Linux - Security 1 09-28-2001 09:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration