LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to close listening port in Ubuntu 10.04 (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-close-listening-port-in-ubuntu-10-04-a-818605/)

unraisedarc 07-07-2010 09:51 PM

How to close listening port in Ubuntu 10.04
 
I know that ports are, by default, not filtered; they simply don't respond to requests if there are no services listening on the port. Well, running netstat -tulpn gives:
Code:

tcp        0      0 0.0.0.0:22              0.0.0.0:*              LISTEN      -             
tcp        0      0 127.0.0.1:631          0.0.0.0:*              LISTEN      -             
tcp        0      0 0.0.0.0:7654            0.0.0.0:*              LISTEN      2106/transmission
tcp6      0      0 :::22                  :::*                    LISTEN      -             
tcp6      0      0 ::1:631                :::*                    LISTEN      -             
tcp6      0      0 :::7654                :::*                    LISTEN      2106/transmission
udp        0      0 0.0.0.0:57366          0.0.0.0:*                          -             
udp        0      0 0.0.0.0:68              0.0.0.0:*                          -             
udp        0      0 0.0.0.0:7654            0.0.0.0:*                          2106/transmission
udp        0      0 0.0.0.0:5353            0.0.0.0:*                          -

And running sudo lsof -i tcp:631 gives

Code:

COMMAND  PID USER  FD  TYPE DEVICE SIZE/OFF NODE NAME
cupsd  1156 root    6u  IPv6  5081      0t0  TCP localhost:ipp (LISTEN)
cupsd  1156 root    7u  IPv4  5082      0t0  TCP pc002-laptop:ipp (LISTEN)

I want to end the services that are listening on port 631, but I'm not sure how to do that. Some sources say xinit.conf, others say init.conf, and others say /etc/services, but I don't really know what to do so that this cupsd doesn't start automatically. I do not run a printing server on this box.

Thanks!

unraisedarc 07-07-2010 10:00 PM

Ok, just realized I could simply kill the PID of the service to end it.

Code:

ps aux | grep cupsd
Code:

kill -9 <PID>
I just need to know how to preven cupsd from running on startup.

mryuck 07-07-2010 10:17 PM

localhost:631 is the cups web browser admin interface.
If you have no printer you could just uninstall cups.

vikas027 07-07-2010 10:24 PM

Stop Cups service for that session
Code:

service cupsd stop
Stop it permanently, so you dont have it even after a reboot.
Code:

chkconfig cupsd off


All times are GMT -5. The time now is 08:17 PM.