[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ports 1024 and 6000, what are they for?



Paul,

> (I'm here to demonstrate my ignorance)

We all start out ignorant of the world - it is only be asking
questions that this can change ;)

> What are port numbers 1024 and 6000 used for?

Port 1024 might be squid and port 6000 is probably your X server.
To find out for sure, use lsof(8), as follows.

    $ dpkg --search `which lsof`
    lsof-2.2: /usr/sbin/lsof
    $ whatis lsof
    lsof (8)             - list open files
    $ sudo lsof -i tcp:6000
    COMMAND   PID USER   FD   TYPE DEVICE SIZE NODE NAME
    XF86_SVGA 291 root    0u  IPv4    368       TCP *:6000 (LISTEN)

If you are looking at which ports your host is listening to, the
following is useful way to check.  This also one of the fastest
ways to list udp ports.

    $ netstat -anA inet
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State
    tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN
    udp        0      0 xxx.xxx.xxx.xxx:123     0.0.0.0:*
    udp        0      0 127.0.0.1:123           0.0.0.0:*
    udp        0      0 0.0.0.0:123             0.0.0.0:*
    raw        0      0 0.0.0.0:1               0.0.0.0:*               7
    raw        0      0 0.0.0.0:6               0.0.0.0:*               7

I normally run my X server with the "-nolisten tcp" option so
that my end-user workstations don't listen on port 6000.  Here's
how I do this on my Debian woody boxes.

    $ cat /etc/X11/xinit/xserverrc
    #!/bin/sh
    #
    # /etc/X11/xinit/xserverrc
    #
    # global xserverrc file, describes how to start the X server.
    #
    # Do not listen on TCP port 6000 (use ssh forwarding).
    exec X -nolisten tcp :0

Yours sincerely,

-- Mark John Suter  | I know that you  believe  you understand
suter@humbug.org.au | what you think I said, but I am not sure
GPG key id F2FEBB36 | you realise that what you  heard  is not
Ph: +61 4 1126 2316 | what I meant.                  anonymous

Attachment: pgp2iur87yU3r.pgp
Description: PGP signature


Reply to: