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 - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-16-2003, 11:21 PM   #1
ocularbob
Member
 
Registered: Nov 2002
Location: brooklyn NYC
Distribution: gentoo
Posts: 212

Rep: Reputation: 30
X and ssh


when i try to launch and X-11 app from the command line over ssh i get this erro.

Gtk-WARNING **: cannot open display:

or

konqueror: cannot connect to X server

I wonder if anyone might know the root of this problem. I've been looking around for some sort of xserver config file.
thanks for any help.
 
Old 01-17-2003, 12:35 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
And I assume you have X11 forwarding thru ssh ? Or are you trying to launch an app thru ssh from just the command line ?
 
Old 01-17-2003, 12:41 AM   #3
ocularbob
Member
 
Registered: Nov 2002
Location: brooklyn NYC
Distribution: gentoo
Posts: 212

Original Poster
Rep: Reputation: 30
i am just launching from camand line but X11 forwarding is enabled on both ends. I tried to run konqueror from command line after logging in with
"ssh -X" and got back:
Xlib: connection to "localhost:10.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
konqueror: cannot connect to X server localhost:10.0
 
Old 01-17-2003, 12:48 AM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
I'm not totally familiar with X11 forwarding thru ssh but from my understanding when you connect with ssh -X and your connected, don't you have to startx first to run any applications ? Is the actual X server or X running when your trying to launch a program ?
 
Old 01-17-2003, 01:13 AM   #5
ocularbob
Member
 
Registered: Nov 2002
Location: brooklyn NYC
Distribution: gentoo
Posts: 212

Original Poster
Rep: Reputation: 30
well i hadn't really ever started a full x session from ssh or even tried before you're last post. when i did i got

# startx


Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.


When reporting a problem related to a server crash, please send
the full server output, not just the last messages.
Please report problems to feedback@suse.de.

Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
giving up.
/usr/X11R6/bin/xinit4: unable to connect to X server
/usr/X11R6/bin/xinit4: No such process (errno 3): Server error.

I had a couple redhat boxes a while back and I could do a plain ol' ssh connection and just #konqueror (or anything else)

I'm starting to think that the problem is with X
 
Old 01-17-2003, 01:33 AM   #6
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
That means you already have an X server running.

Try this and see if it works:

startx -- :1
 
Old 01-17-2003, 01:38 AM   #7
ocularbob
Member
 
Registered: Nov 2002
Location: brooklyn NYC
Distribution: gentoo
Posts: 212

Original Poster
Rep: Reputation: 30
same result..
do i need to setup another "screen" in XF86Config?
not that i would know exactly how to do that....
 
Old 01-17-2003, 07:33 AM   #8
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
You should have these options set on the sshd server
(/etc/ssh/sshd_config):

Code:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
On the ssh client (/etc/ssh/ssh_config):

Code:
   ForwardAgent yes
   ForwardX11 yes
The error you are seeing is because an X server on your ssh
server is running, and ssh isn't setting the DISPLAY variable
correctly in order to display to your ssh client. This is probably
because you are either not running X on your ssh client, or you
don't have all the options set as above.

You need to be running X on the ssh client in order for tunneling
to work. If you'd like to run a window manager from the ssh
server, see a related post:
http://www.linuxquestions.org/questi...threadid=41505

man ssh
man sshd

Last edited by moses; 01-17-2003 at 12:37 PM.
 
Old 01-17-2003, 11:49 AM   #9
ocularbob
Member
 
Registered: Nov 2002
Location: brooklyn NYC
Distribution: gentoo
Posts: 212

Original Poster
Rep: Reputation: 30
hmm..
both configs are setup properly and were from the get go.
both machines are already running X to their own display.
the problem seems to be that it won't let there be two X sessions at once.
All i want to do is run an X app on the host machine from the client.
 
Old 01-17-2003, 12:32 PM   #10
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
ssh into your server (the one running sshd), and type the
following, then post the output:
Code:
printenv DISPLAY
It should be something like:
servername:11.0
where servername is the machine running sshd.
It should not be:
servername:0.0
Setting this yourself will defeat the security of ssh (for X only),
but you could do so.

Also, does the user have a ~/.ssh/config file? If so, are the config
options mentioned above for ssh_config negated?

Last edited by moses; 01-17-2003 at 12:41 PM.
 
Old 01-17-2003, 01:15 PM   #11
ocularbob
Member
 
Registered: Nov 2002
Location: brooklyn NYC
Distribution: gentoo
Posts: 212

Original Poster
Rep: Reputation: 30
ok i got it to go! nice man nice.

so the root of all of my problems seems to always be related to some
VARIABLE in capital letters. what is the standard way to check and edit these. thanks alot
 
Old 01-17-2003, 01:50 PM   #12
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
It depends on your shell.
for all shells:
Code:
printenv
or
Code:
env
will display your environment.
For bourne shells (bash, sh, ksh, etc.)
Code:
export ENVVAR=value
will export ENVVAR with the value "value" to your environment.
For C-shells (csh, tcsh, etc.)
Code:
setenv ENVVAR value
will do it.
 
Old 01-18-2003, 07:36 AM   #13
ocularbob
Member
 
Registered: Nov 2002
Location: brooklyn NYC
Distribution: gentoo
Posts: 212

Original Poster
Rep: Reputation: 30
hey cool,
thanks alot for you're help.
I'm starting a new thread
"X11 config files?"
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh-agent, ssh-add and ssh-keygen AND CVS raylpc Linux - General 2 11-19-2008 02:50 AM
[SSH] Issue logging in [SSH & Permissions] MD3 Linux - Networking 11 12-10-2006 09:25 AM
Mac OS X ssh client / linux sshd : ssh hangs/disconnects Apollo77 Linux - Networking 1 05-24-2006 11:53 AM
I turned off SSH, but I cant get it back! How do you start SSH on boot? nmoog Slackware 2 02-08-2004 05:18 PM
ssh issue: /usr/bin/ssh -x -oFallBackToRsh no -l WeNdeL Linux - Software 1 03-04-2003 07:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:08 AM.

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