Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how do I close the port 37 ?

Posted on 2006-10-20
5
Medium Priority
?
1,426 Views
Last Modified: 2013-12-05
Hi.
My linux (slackware)  is listening on TCP/UDP port 37. How can I stop this time service.
Is there some security problem or something depends on it?
Sorry my english.
0
Comment
Question by:edgardvieira
  • 2
  • 2
5 Comments
 
LVL 7

Expert Comment

by:Chatable
ID: 17777268
I found this website: http://www.auditmypc.com/port/udp-port-37.asp
This website states that port 37 is used for:
"Time. Provides remote timing stat's of internal processing events. Security Concerns: Gives remote attacker info on host's internal processing load. Can identify critical processing times, plus output can be looped to echo port (7) and create a DOS threat to the subnet. Disable this port on all hosts."
Well I don't agree that this is a major security concern however it still might be a good idea to close it.

Okay since I don't have slackware I will relate to the general task of closing an unneeded open port.
First you determine which application is bound to this port. Run this: netstat --inet -anp
This will dump a list of all open ports along with the PID of their associated process. Then, once you have the PID you can determine which program it is by running: ps -ef
Once you've found the program simply stop it and remove it from your /etc/rc#.d folder so it doesn't execute on startup.
An alternative approach is to simply use the linux built-in firewall (iptables) to block access to unneccessary ports.
You may check this page for an iptables guide: http://iptables-tutorial.frozentux.net/iptables-tutorial.html
0
 
LVL 35

Accepted Solution

by:
Duncan Roe earned 2000 total points
ID: 17778170
I find lsof easier to use than netstat:

10:36:02# lsof -i :time
COMMAND PID USER   FD   TYPE DEVICE SIZE NODE NAME
inetd   566 root    4u  IPv4    654       TCP *:time (LISTEN)
inetd   566 root    5u  IPv4    655       UDP *:time

On my (Slackware) system, inetd is accepting time calls (along with a lot of other ports, but I asked lsof to only show the time port ("man lsof" for an explanation)).

If you don't want the time service to be enabled, edit /etc/inetd.conf, to comment-out these 2 lines:

time    stream  tcp     nowait  root    internal
time    dgram   udp     wait    root    internal

These lines correspond exactly to the 2 entries that lsof showed earlier
0
 
LVL 35

Expert Comment

by:Duncan Roe
ID: 17778180
After changing /etc/inetd.conf, send SIGHUP to the inetd process to have them take effect:

killall -HUP inetd
0
 
LVL 7

Expert Comment

by:Chatable
ID: 17779624
omg you're right, I forgot to relate to inetd... killing inetd isn't a good idea.
if inetd is indeed the process that listens on port 37 you should definitely do what duncan_roe has suggested.
0
 

Author Comment

by:edgardvieira
ID: 17794827
Sorry my delay.
Thanks.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question