Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 04-15-2004, 07:00 PM   #1
LQ Newbie
Registered: Apr 2004
Posts: 19

Rep: Reputation: 0
X server keeps refusing remote X connection

I am trying to log on to a computer that is hosted by my university for programming and have X windows sent to my computer, i.e.,
I ssh to and I want to type "emacs" and have the window show up on my monitor.

However, the school does not support X forwarding through ssh, and when I set the DISPLAY variable on the remote host to my computer like such:
setenv DISPLAY
I then allow all connections on my local computer:
xhost +
Then I try and load the window:
It responds:
emacs: Cannot connect to X server
Check the DISPLAY environment variable or use `-d'.
Also use the `xhost' program to verify that it is set to permit
connections from your machine.

Also if I set the DISPLAY variable to on my local computer, it STILL won't connect to the X server.

What could be going wrong?
Old 04-16-2004, 06:09 AM   #2
Senior Member
Registered: Aug 2003
Location: Sydney
Distribution: debian
Posts: 1,495

Rep: Reputation: 48
If you just want to use emacs, simplest thing is to start it in a console with 'emacs -nw'. This stops it trying to open a window in the local machine, and it runs in the console instead. Since emacs was originally designed to run this way, there is not much loss of functionality.

Otherwise I think you do something called 'X11 forwarding'. See the tutorial at

for example, or search google for '"X11 forwarding" ssh linux' for lots more info.
Old 04-16-2004, 09:08 AM   #3
LQ Newbie
Registered: Apr 2004
Posts: 19

Original Poster
Rep: Reputation: 0
I actually did end up using emacs without making a terminal window - but that's not what I want. I work faster if I can have more than one emacs window going at once, and there are other various reasons.

X forwarding using ssh works great, but unfortunately the computer I am ssh'ing into does not support this (i think i said this).

What's bothering me is that I SHOULD be able to do this the old fashioned way, but my computer seems to be refusing all connections -- I can't even locally say and have it work.

What besides xhost + and checking my hosts.deny and hosts.allow can I do to troubleshoot this problem? What could be happening?

Old 04-16-2004, 11:13 AM   #4
Senior Member
Registered: Aug 2003
Location: Sydney
Distribution: debian
Posts: 1,495

Rep: Reputation: 48
Sorry - I realised after I posted that you had mentioned X forwarding.

There is another X access control thing called xauth, which I thought was supposed to be the successor to the xhost file. Don't know much about it, but it has a detailed man page.

Otherwise check /var/log/XFree86.0.log and anything else in /var/log that might be recording connection attempts??

No firewall blocking access??

Could try running tcpdump and watching for incoming connection attempts if you get desperate.

Just guessing.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
sshd refusing remote connection from SecureCRT 60s TV Batman *BSD 2 06-08-2005 04:45 PM
SMTP Server refusing connection from app on localhost using Fedora 2 tnine9 Linux - Networking 1 10-08-2004 12:43 PM
Server refusing SMTP connection requests Lunch Linux - Networking 3 03-16-2004 09:06 AM
Remote Connection to mysql server Graanco Linux - General 1 07-18-2003 11:27 PM
server refusing remote connections (@Home) dlb Linux - Networking 2 11-26-2001 02:48 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:10 AM.

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