Disable Unused Services

I'm new to Linode and web servers and Linux in general. I've been working through the Linode Library and other online guides.

I'm stuck on the "Disable Unused Services" section in the Linode Library. Whereas other portions of the Linode Library guides have been rather detailed, this section doesn't help a newbie like myself very much.

I see the instructions for installing htop. But after I do that…

1. What command do I use to see all processes currently running?

2. How can I determine which of these services are necessary for my purposes and which can be disabled? (For the record, I basically just want to run some WordPress websites on my linode.)

3. According to the Library guide, "Please note that services that are configured to start at system boot will run again should you reboot your server, so it may be safer to disable them from automatically starting using your distribution's particular method for doing so." What is Ubuntu 12.04's particular method for doing so?

I am generally opposed to starting new forum topics, so I searched through this forum and the rest of the Internet for answers to these questions. While I found some information on other websites, I couldn't tell if the instructions given there were geared toward a setup like a linode and none of the instructions I found answered all of these questions.

Thanks.

10 Replies

1. With htop you can see the processes. However, what you want to know is your listening processes. For this you can use netstat. eg. netstat -tulpe

Look at the processes in a listening state. Make sure your terminal window is big enough stuff fit's on a single line. You'll also see the program name and PID on the end, so the stuff that is not needed can be disabled. Normally this is /etc/init.d/ stop

2. You'll probably only want Apache/Nginx/Mysql/PHP/SSH/exim(or whatever you use for mail) in a listening state.

3. update-rc.d -f remove (or disable)

The part is how it is listed in /etc/init.d/

@Kyle:

1. What command do I use to see all processes currently running? Google

@Kyle:

2. How can I determine which of these services are necessary for my purposes and which can be disabled? Google

@Kyle:

3. What is Ubuntu 12.04's particular method for doing so? Google

Just kidding :lol: (more or less)

But for general linux questions, it's quicker just to google them.

@Nuvini:

1. With htop you can see the processes. However, what you want to know is your listening processes. For this you can use netstat. eg. netstat -tulpe

Look at the processes in a listening state. Make sure your terminal window is big enough stuff fit's on a single line. You'll also see the program name and PID on the end, so the stuff that is not needed can be disabled. Normally this is /etc/init.d/ stop

2. You'll probably only want Apache/Nginx/Mysql/PHP/SSH/exim(or whatever you use for mail) in a listening state.

3. update-rc.d -f remove (or disable)

The part is how it is listed in /etc/init.d/

And ntpd you'll want that running too :)

@obs:

@Nuvini:

1. With htop you can see the processes. However, what you want to know is your listening processes. For this you can use netstat. eg. netstat -tulpe

Look at the processes in a listening state. Make sure your terminal window is big enough stuff fit's on a single line. You'll also see the program name and PID on the end, so the stuff that is not needed can be disabled. Normally this is /etc/init.d/ stop

2. You'll probably only want Apache/Nginx/Mysql/PHP/SSH/exim(or whatever you use for mail) in a listening state.

3. update-rc.d -f remove (or disable)

The part is how it is listed in /etc/init.d/

And ntpd you'll want that running too :)

True. Except when leap seconds occur :mrgreen:

First, thank you all for the help. I really do appreciate it.

@Nuvini:

However, what you want to know is your listening processes.
I thought the goal was to disable all running processes that aren't being used in order to free system resources and remove potential security vulnerabilities. What's the reason for only wanting to know listening processes?

If they want to abuse the running processes that aren't listening they first need to get in your system. So the first thing is to disable those listening services, reducing the potential points where they can get in.

Then while personally I don't think someone is gonna abuse processes like that once they're on your system, it's possible. Still, it depends on what you have running and installed. (e.g. Anacron can usually be disabled if it's running)

I tried running netstat -tulpe and none of the processes listed show a Program Name, they are all just '-'.

Did you run the command as root?

-Tim

I did not, works now :) I seem to have 8 instances of ntpd running on udp and udp6.. can those be removed?

NTP is definitely needed to keep your clock synchronized with the rest of the world.

-Tim

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct