remove ssh/apache etc from starting????

Soldato
Joined
17 Oct 2002
Posts
3,103
Hi,
I notice I have a lot of services opening ports on my pc. I'm behind a firewall and router but I was wandering if I could remove them from starting.
Code:
ftp                     
ssh                     
smtp                    
time                    
finger                  
http                    
sunrpc                  
auth                    
submission              
ipp                     
X11
 
If you're on a RedHat clone (Mandrake, RH, Suse?) then run ntsysv from a commandline as root. You can choose which services to start at boot here.
 
All of your boot scripts are in /etc/rc.d/rc?.d where ? is the run level. If you are booting to a graphical login then its most likely that you are using run level 6. Remove the scripts links in this directory that you do not want to use and they won't start on boot.

Scripts that you need to remove are the ones that that with S e.g. to stop ftp from starting on boot remove S30ftp (its name will be different).
 
cool :) I'll take a look

I seem to have rc.processname. e.g. rc.sshd and I only have rc.0 rc.4 and rc.6. rc.0 is a link to rc.6 and I can't find starting of sshd etc in 4 or 6 :(
 
Last edited:
They might also be being started from xinetd or inetd, in which case you should be able to edit the files in /etc/[x]inetd/.

Just a thought

[edit]
Actulaly SSHD cant start from [x]inetd so ignore that one, but ftp might
[/edit]
 
Last edited:
After a quick look I see Slackware uses BSD style bootscripts.

Do you have a rc.local?

Edit:

The boot process also starts things from /etc/rc.d/rc.sysinit so you may want to have a peek at that too.
 
Last edited:
Think I may have found the script initializing them. rc.M. I found this after searching thru the net.

Code:
    * rc.0 = The rc.0 file is a symlink to rc.6
    * rc.M = The init script for multi-user runlevels 2, 3, and 5
    * rc.K = The "administrative" runlevel, single user mode
    * rc.S = The system initialization script
    * rc.4 = The init script for runlevel 4, which is the runlevel that automatically boots into the X Session Manager of choice
    * rc.6 = The script executed by init when rebooting or halting the system

:) I'm gonna try it I guess ssh/httpd etc aren't needed for normal running of linux
 
http will be your webserver (if you run one)
ssh if you access your box remotely
Technically you don't need smtp, finger or time either...
 
Last edited:
I've removed loads of services now and only have a list of 4 net services.

Code:
sunrpc                  
auth                    
ipp                     
X11

I found sunrpc in /etc/inetd.config but it was disabled from starting so I don't know why that's still there but seems a lot better than it was and I thought I'd better disable ssh as it seems a bit risky to leave it running esp with this new linux virus which opens ssh :(

cheers for the help :D

nice to have the forum back up again :)
 
you can comment out any services you dont need in /etc/services and your /etc/inetd.conf (or equivalent). Theres a way to stop X11 (X-Windows) from opening a port, its a line you have to add in one of the conf files but I cant remember it - anyone else?
 
Originally posted by r00t
you can comment out any services you dont need in /etc/services and your /etc/inetd.conf (or equivalent). Theres a way to stop X11 (X-Windows) from opening a port, its a line you have to add in one of the conf files but I cant remember it - anyone else?

That will only stop the machine from accepting services on certain ports. It won't stop the daemon from running on boot.
 
The way I did it for a quick fix was to get it to execute a script on my login that kills the services that i dont require. Alright it may be a bad way to sort it out but it wasnt my box and I only had 5 mins :p

Shak
 
Originally posted by Shak
The way I did it for a quick fix was to get it to execute a script on my login that kills the services that i dont require. Alright it may be a bad way to sort it out but it wasnt my box and I only had 5 mins :p

Shak

Doesn't that mean the services would start and then stop ????

I removed PCMCIA also cos that seems to take a bit of time on startup :)
 
Originally posted by mortals
Doesn't that mean the services would start and then stop ????

I removed PCMCIA also cos that seems to take a bit of time on startup :)

Yeah the services started, and then were killled, like I said I didnt have much time and it was the quick and easy method!

Shak
 
Back
Top Bottom