LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-09-2003, 07:46 AM   #1
Tigger
Member
 
Registered: May 2003
Posts: 168

Rep: Reputation: 30
closing ports


Hi

i am running a mail and web server using red hat 8 server.

I ran languard on my system and it is showing i have ports 161 (snmp) and 520 (RIP) and 389 (LDAP) open.

How can i close these ports once and for all? I thought by stopping the services this would stop them but it has not. Hopefully these ports will not be needed by my mail and web server.

Also, it shows i have port 1900 (simple service discovery protocol) open as well. Is this one necessary?

thanks
 
Old 06-09-2003, 02:14 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,578

Rep: Reputation: 191Reputation: 191
You can safely close all 4 ports by closing the apps that open them. What do you mean when you say that you turned them off and they're still up? Have you rebooted after you closed them?

The command to show open ports is 'netstat -l'. Run it, then close the services and 'netstat -l' again. Is it better?

And, last questions, how do you close them?
 
Old 06-09-2003, 03:57 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
//moderator note: Tigger already asked this very same question in /Security and it was answered to in multiple ways. See here.

Tigger: just so we know how to help you better, what is it you don't understand you need to ask the same question twice?
 
Old 06-09-2003, 04:41 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,578

Rep: Reputation: 191Reputation: 191
Tigger, could you explain what was unclear in the previous thread? What is the situation now?

Last edited by Mara; 06-09-2003 at 04:44 PM.
 
Old 06-09-2003, 05:27 PM   #5
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
i do not understand /etc/rc.d/rc(runlevel).d or xinetd.

Do they mean edit these? If so, how do i know the runlevel?

thanks
 
Old 06-09-2003, 05:42 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
Tigger, please understand there are NO stupid questions at LQ.
The only thing that's really stupid is NOT asking, OK?

To get the runlevel type "/sbin/runlevel" in the console. The second character it shows is the runlevel you're in. For instance, if it says "3" that means the init script links are in /etc/rc.d/rc3.d .
If you do not want to maintain those links manually (is not hard tho), use ntsysv, tksysv, chkconfig or whatever Red Hat system applet does the trick.
 
Old 06-09-2003, 11:15 PM   #7
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
thankyou unSpawn. These groups are great!!!

Yes, sometimes i feel very very stupid.

I will try this today and let you know how i go
 
Old 06-10-2003, 04:28 AM   #8
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
help, i cannot edit these files because they are read only. The file i am trying to edit is rc5.d. How can i change the permissions please?

thanks again
 
Old 06-10-2003, 04:30 AM   #9
neenee
Member
 
Registered: Feb 2003
Location: Netherlands
Distribution: debian (sid)
Posts: 693

Rep: Reputation: 30
try opening a console, then typing su, enter your
root pass. then you can use nano, pico, or the
text editor of your choice to edit the files.
 
Old 06-10-2003, 08:16 AM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
help, i cannot edit these files because they are read only. The file i am trying to edit is rc5.d.
rc5.d is a directory (/etc/rc.d/rc5.d), and is not to be edited.
Look inside the directory: "ls -al /etc/rc.d/rc5.d". If you're going to edit system files, make sure you're root. Also if you're going to edit files manually, make sure you back them up.
Also in /etc/rc.d/rc5.d are no files, but symbolic links. The actual files reside in /etc/rc.d/init.d, the links in /etc/rc.d/rc5.d change the start/stop behaviour and the place in the startup sequence a service is started/stopped as. Read for instance "man chkconfig" for details.
 
Old 06-10-2003, 08:21 AM   #11
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
thanks unspawn, i have got a lot of learning to do LOL
 
Old 06-10-2003, 09:57 PM   #12
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
hey, everyone, i am more confused than before!!!!! I tried to edit these files but do not know what to do in the files. Do i put a # in front of the service in init.d or do i just delete the lines?

thanks again
 
Old 06-11-2003, 08:53 AM   #13
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
i still need help please? Anyone?

thanks
 
Old 06-11-2003, 12:02 PM   #14
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,578

Rep: Reputation: 191Reputation: 191
Don't edit the files. What you need to do is turn off unneded services. First look at the list:
chkconfig --list
It will show a table. Numbers mean runlevels (3 is console mode with network, 5 X-Window <- the most popular one).
To turn a service off/on use something like this:
chkconfig --level 3 nfs off
it turns off service nfs on level 3.
 
Old 06-11-2003, 02:34 PM   #15
Tigger
Member
 
Registered: May 2003
Posts: 168

Original Poster
Rep: Reputation: 30
thanks mara but i have done this and when i run languard from across the internet it says that the ports are still open.

I do not understand. Are they open or not?

thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing ports??? NCC-1701&NCC-1701-D Linux - Security 6 05-29-2005 10:23 AM
Closing these ports... greygoose80 Slackware 2 12-20-2004 12:12 AM
Closing Some Ports wonderpun Linux - Security 8 08-17-2003 04:09 PM
closing ports im1crazyassmofo Linux - Security 2 01-02-2003 10:50 PM
CLOSING PORTS Stephanie Linux - Security 9 05-23-2001 01:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration