I am using RHEL 6.0 and when i type the given command in terminal

telnet 6000

I am getting output as:

telnet: connect to address Connection refused

Why is this connection refusing?

  • 3
    Presumably, because there's nothing running on localhost that's listening on TCP port 6000. – Shadur Jan 31 '14 at 7:47

Because there's nothing listening there. If you'd expect an X server to answer, you'll need to tell it to enable TCP (remove the -nolisten tcp for instance, or add -listen tcp for those that don't listen on TCP by default).

But if you don't need your X server to be accessed directly over the network (other than tunnelled/proxied over ssh), it's probably wiser to leave it there.

You can connect to your X server with a Unix domain socket instead. For instance (for :0) with:

socat - /tmp/.X11-unix/X0

Which would be the equivalent of:

socat - tcp:localhost:6000

Or (as you're on Linux), with an abstract domain socket:

socat - abstract:/tmp/.X11-unix/X0

Other reasons why you can't talk to your X server would be if it's listening on a different port (6000 is for the :0 display) or not at that address or the wildcard address, or on a different network protocol (IPv6 instead of IPv4), or if there's a firewall rule rejecting connections there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.