You are on page 1of 4

Unix & Linux

Sign up

Log in

Questions Tags Users Badges Ask

Up vote

Down vote

telnet: connect to address 127.0.0.1: Connection refused

rhel telnet

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

telnet 127.0.0.1 6000

I am getting output as:

Trying 127.0.0.1...

telnet: connect to address 127.0.0.1: Connection refused

Why is this connection refusing?

Share Improve this question Follow

asked

Jan 31 '14 at 7:32

msz
181●22 gold badges●22 silver badges●1010 bronze badges edited

Jan 31 '14 at 7:39

Timo

5,846●2323 silver badges●2727 bronze badges

Presumably, because there's nothing running on localhost that's listening on TCP port 6000. –

Shadur

Jan 31 '14 at 7:47

Add a comment

Report this ad

1 Answer

order by

votes

Up vote

Down vote

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.

Share Improve this answer Follow

answered

Jan 31 '14 at 7:43

Stéphane Chazelas

439k●7878 gold badges●865865 silver badges●12961296 bronze badges edited

Feb 6 '17 at 11:39

Your Answer

Body

Add picture

OR
Name

Email

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

meta chat tour help blog privacy policy legal contact us cookie settings full site

2021 Stack Exchange, Inc. user contributions under cc by-sa

You might also like