netstat help

When i run netstat i get a load of Unix ports:

Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 ACC ] STREAM LISTENING 4474 /var/run/.resmgr_socket
unix 2 ACC ] STREAM LISTENING 4431 /var/run/dbus/system_bus_socket
unix 2 ACC ] STREAM LISTENING 4545 /var/run/acpid.socket
unix 2 ACC ] STREAM LISTENING 7385 /tmp/.ICE-unix/2568
unix 2 ACC ] STREAM LISTENING 5456 /var/run/xdmctl/dmctl/socket
unix 2 ACC ] STREAM LISTENING 5465 /var/run/xdmctl/dmctl-:0/socket
unix 2 ACC ] STREAM LISTENING 8079 /tmp/.ICE-unix/dcop2688-1220886657
unix 2 ACC ] STREAM LISTENING 10576 private/trace
unix 2 ACC ] STREAM LISTENING 10580 private/verify
unix 2 ACC ] STREAM LISTENING 10584 public/flush
unix 2 ACC ] STREAM LISTENING 10588 private/proxymap
unix 2 ACC ] STREAM LISTENING 5462 /tmp/.X11-unix/X0
unix 2 ACC ] STREAM LISTENING 4785 @/var/run/hald/dbus-ATo6rWW6Pd
unix 2 ACC ] STREAM LISTENING 6781 /tmp/ssh-fxoFH2090/agent.2090
unix 2 ACC ] STREAM LISTENING 10592 private/smtp
unix 2 ACC ] STREAM LISTENING 10596 private/relay
unix 2 ACC ] STREAM LISTENING 10600 public/showq
unix 2 ACC ] STREAM LISTENING 10604 private/error
unix 2 ACC ] STREAM LISTENING 10608 private/discard
unix 2 ACC ] STREAM LISTENING 10612 private/local
unix 2 ACC ] STREAM LISTENING 5461 @/tmp/.X11-unix/X0
unix 2 ACC ] STREAM LISTENING 4782 @/var/run/hald/dbus-yKs22GEME3
unix 2 ACC ] STREAM LISTENING 6756 /var/run/audispd_events
unix 2 ACC ] STREAM LISTENING 10616 private/virtual
unix 2 ACC ] STREAM LISTENING 6811 /var/run/avahi-daemon/socket
unix 2 ACC ] STREAM LISTENING 6981 /var/run/cups/cups.sock
unix 2 ACC ] STREAM LISTENING 10557 public/cleanup
unix 2 ACC ] STREAM LISTENING 10564 private/rewrite
unix 2 ACC ] STREAM LISTENING 10568 private/bounce
unix 2 ACC ] STREAM LISTENING 32777 /tmp/orbit-rory/linc-57f5-0-51a4cad816887
unix 2 ACC ] STREAM LISTENING 10572 private/defer
unix 2 ACC ] STREAM LISTENING 10620 private/lmtp
unix 2 ACC ] STREAM LISTENING 10624 private/anvil
unix 2 ACC ] STREAM LISTENING 10628 private/scache
unix 2 ACC ] STREAM LISTENING 10632 private/maildrop
unix 2 ACC ] STREAM LISTENING 10636 private/cyrus
unix 2 ACC ] STREAM LISTENING 10640 private/uucp
unix 2 ACC ] STREAM LISTENING 10644 private/ifmail
unix 2 ACC ] STREAM LISTENING 10648 private/bsmtp
unix 2 ACC ] STREAM LISTENING 10652 private/procmail
unix 2 ACC ] STREAM LISTENING 8055 /tmp/ksocket-rory/kdeinit__0
unix 2 ACC ] STREAM LISTENING 10656 private/retry
unix 2 ACC ] STREAM LISTENING 10660 private/proxywrite
unix 2 ACC ] STREAM LISTENING 8058 /tmp/ksocket-rory/kdeinit-:0
unix 2 ACC ] STREAM LISTENING 9598 /tmp/ksocket-rory/kdesud_:0
unix 2 ACC ] STREAM LISTENING 8109 /tmp/ksocket-rory/klauncherb6lm4b.slave-socket
unix 2 ACC ] STREAM LISTENING 32783 /tmp/orbit-rory/linc-57f3-0-548fd9a92e976
unix 2 ACC ] STREAM LISTENING 7025 @/tmp/dbus-7WRUdXHgcg
unix 2 ACC ] STREAM LISTENING 7044 /tmp/ksocket-rory/kdeinit4__0
unix 2 ACC ] STREAM LISTENING 7056 /tmp/ksocket-rory/klauncherMT2457.slave-socket
unix 2 ACC ] STREAM LISTENING 7384 @/tmp/.ICE-unix/2568

Should these be here? What are they and how do i stop them from showing up when i do netstat? How do i just show my open ports, nothing else, in a list. E.G:

21
23
80
81

(is that even possible?)

Also, how do i open a port? I have my firewall turned off.

Thanks in advance.

Turn your firewall back ON.

Use Yast and go to the Firewall section.
Go to Allowed Services then the advanced section. Add Port numbers as required. Do the same in your router if you have one.

As for the results
Not much idea. Only it looks rather odd to me, nothing like mine
here is a sample:
unix 3 ] STREAM CONNECTED 7252 @/var/run/hald/dbus-QItAX29GSz
unix 3 ] STREAM CONNECTED 7251
unix 3 ] STREAM CONNECTED 7239 /var/run/dbus/system_bus_socket
unix 3 ] STREAM CONNECTED 7238
unix 3 ] STREAM CONNECTED 7200 @/var/run/hald/dbus-QItAX29GSz
unix 3 ] STREAM CONNECTED 7199
unix 3 ] STREAM CONNECTED 7198 /var/run/dbus/system_bus_socket
unix 3 ] STREAM CONNECTED 7197
unix 3 ] STREAM CONNECTED 6082 @/var/run/hald/dbus-QItAX29GSz
unix 3 ] STREAM CONNECTED 6060
unix 3 ] STREAM CONNECTED 6013 /var/run/dbus/system_bus_socket
unix 3 ] STREAM CONNECTED 6012
unix 3 ] STREAM CONNECTED 6011 /var/run/acpid.socket
unix 3 ] STREAM CONNECTED 6010
unix 3 ] STREAM CONNECTED 6006 @/var/run/hald/dbus-QItAX29GSz
unix 3 ] STREAM CONNECTED 6001
unix 3 ] STREAM CONNECTED 6005 @/var/run/hald/dbus-QItAX29GSz
unix 3 ] STREAM CONNECTED 5973
unix 3 ] STREAM CONNECTED 5586 @/var/run/hald/dbus-8m8cjXV1Sl
unix 3 ] STREAM CONNECTED 5585
unix 3 ] STREAM CONNECTED 5568 /var/run/dbus/system_bus_socket
unix 3 ] STREAM CONNECTED 5567
unix 3 ] STREAM CONNECTED 5552 /var/run/dbus/system_bus_socket

OK, done that. Is there any way to allow one IP address (internal to my network) access to ALL my ports?

Use the -t to display TCP sockets, -u for UDP sockets and -x for Unix sockets.

See netstat man page.

netstat -t doesn’t show my LISTEN ports. I am trying to get port 303 to be listening to connections, Then i want to check its listening with netstat. How do i do that??

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The listing of all the unix sockets is normal. If you want to just show
listening TCP ports use grep:

netstat -anp | grep 'LISTEN ’

Copy/paste EXACTLY since if you remove the space you think is a typo
you’ll end up with all the unix stuff again.

Good luck.

caf4926 wrote:
> Turn your firewall back ON.
>
> Use Yast and go to the Firewall section.
> Go to Allowed Services then the advanced section. Add Port numbers as
> required. Do the same in your router if you have one.
>
> As for the results
> Not much idea. Only it looks rather odd to me, nothing like mine
> here is a sample:
> unix 3 ] STREAM CONNECTED 7252
> @/var/run/hald/dbus-QItAX29GSz
> unix 3 ] STREAM CONNECTED 7251
> unix 3 ] STREAM CONNECTED 7239
> /var/run/dbus/system_bus_socket
> unix 3 ] STREAM CONNECTED 7238
> unix 3 ] STREAM CONNECTED 7200
> @/var/run/hald/dbus-QItAX29GSz
> unix 3 ] STREAM CONNECTED 7199
> unix 3 ] STREAM CONNECTED 7198
> /var/run/dbus/system_bus_socket
> unix 3 ] STREAM CONNECTED 7197
> unix 3 ] STREAM CONNECTED 6082
> @/var/run/hald/dbus-QItAX29GSz
> unix 3 ] STREAM CONNECTED 6060
> unix 3 ] STREAM CONNECTED 6013
> /var/run/dbus/system_bus_socket
> unix 3 ] STREAM CONNECTED 6012
> unix 3 ] STREAM CONNECTED 6011
> /var/run/acpid.socket
> unix 3 ] STREAM CONNECTED 6010
> unix 3 ] STREAM CONNECTED 6006
> @/var/run/hald/dbus-QItAX29GSz
> unix 3 ] STREAM CONNECTED 6001
> unix 3 ] STREAM CONNECTED 6005
> @/var/run/hald/dbus-QItAX29GSz
> unix 3 ] STREAM CONNECTED 5973
> unix 3 ] STREAM CONNECTED 5586
> @/var/run/hald/dbus-8m8cjXV1Sl
> unix 3 ] STREAM CONNECTED 5585
> unix 3 ] STREAM CONNECTED 5568
> /var/run/dbus/system_bus_socket
> unix 3 ] STREAM CONNECTED 5567
> unix 3 ] STREAM CONNECTED 5552
> /var/run/dbus/system_bus_socket
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIxUuh3s42bA80+9kRArOoAJ90RElutUjNdo+g+QKVsbJ+xBt2qACdGL/V
earAMpCi4rQLOF7X33ub+UA=
=kD0/
-----END PGP SIGNATURE-----

You probably need the -a option also. Again, see man netstat.

Opening a port in the firewall didnt show up on netstat -ta. How do i use terminal to open a port?

netstat doesn’t show the rules of the firewall, only what ports processes have open. So the answer is not netstat.

So it means that if the port is not visible in netstat, then you don’t have anything listening at that port so you need to fix this before you worry about the firewall rules.

How do i make port 303 listen, then show it is listening?

You have to run a server process on that port.

ken yap wrote:
> You have to run a server process on that port.
>
>

It’s funny (and a bit sad) that sites like grc.com managed to make
people believe that “opening a port” on a firewall equals “something
listening and letting bad guys in”.

A program makes a port listening (as your are wording it).

The steps are:
run a program (normaly this is a so called deamon) that attaches to port 303 for listening via TCP and/or UDP;
check via netstat that the port is LISTENING;
configure your systems firewall so that it can be seen from outside;
configure the firewall of your router (when in place) so the posrt cn be reached from the internet (when desired).

Do not bother about the unix ports they do not go outside your system.

Edit: i missed the two posts above when typing. And yes they are right, it is sad and not encouraging.

Can anyone recommend one of these programs to use? I don’t need the port opened to the Internet. Just the LAN

Thanks for the help

I am afraid we misunderstand you or you misunderstand us (or both).

One does not simply want a port to be ‘opened’. One wants to run a program that provides a TCP/IP service. That program happens to be configured (or hardcoded) to listen to one (or more) TCP and/or UDP ports. It does so either by himself (e.g. Apache that listen to e.g. port 80 or 8080 or …) or one let xinetd do the listening (and xinetd starts then the service program for every incoming cliient). Examples of the last are ftp and rsync services.

May be when you explain a bit more about what you think an opened port 303 must do? Which service is to be provided?

I wanna ssh using port 303. I know ssh has its own port… But i want to use 303 on both computers i have. I have the command to use ssh with port 303. But doesn’t it need to be listening for a connection??

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

have you set the SSH daemon to use port 303? Look in
/etc/ssh/sshd_config for the parameter. Change from 22 to 303 and
uncomment if necessary, then restart the daemon. Also be sure your
firewall is not blocking the port once this is done.

Good luck.

DrEaMeR23 wrote:
> I wanna ssh using port 303. I know ssh has its own port… But i want to
> use 303 on both computers i have. I have the command to use ssh with
> port 303. But doesn’t it need to be listening for a connection??
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIxqUr3s42bA80+9kRAi7fAJ9m07ije5BvriS30JveKxxV6GIetACdE3Um
PEQjBz7c3XftZU2EHheeplc=
=w1WX
-----END PGP SIGNATURE-----

You want to use ssh as a client and connect to port 303 and behind posrt 303 yoy want the ssh service. The ssh service is normaly provided by the program sshd.

Conclusion: you have to run sshd. This can be done using YaST > System > System Services (runlevel).

But you do not want sshd to listen on port 22, but on 303. That means you have to configure something. See the man page for sshd. There is the -p option, but it can also be put in a configuration file.

(As an extra I personaly find it very convenient to put man:sshd in the address bar of konqueror to read the man page).

Please start reading and exprimenting. When you have further questions you ask them.

You can tes if the sshd runs via:

ps -ef | grep sshd

and if port 303 is listening with

netstat -rn | grep 303

May be a few lines extra will shoe, but you will recocnise the important ones when you see them.

AAAAAHHHH. OK. Thanks

Would this work:

ssh user@IP_ADDRESS - g -R IP_Address:303:Remote_IP:303 -M -p -v -4
??