Removing the avahi-daemon on Ubuntu

15

2

My Ubuntu server basically servers a Python Django site using Apache and Postgre. We SSH to it to configure some stuff from time to time but that's about it for the server. Since I'm trying to harden my installation, I'm trying to remove all useless processes and open ports. I've seen that there's something called avahi-daemonrunning in the background:

avahi     1724     1  0 Jul20 ?        00:00:00   avahi-daemon: running [development.local]
avahi     1726  1724  0 Jul20 ?        00:00:00     avahi-daemon: chroot helper

I've read that it has something to do with discovering other computers and printers on the same network. (I'm not entirely sure and that's even more the reason i feel the need to rid my os of it.)

Is this something important? Can I remove it? If so, how?

Mridang Agarwalla

Posted 2011-07-29T15:50:23.250

Reputation: 617

Answers

16

Avahi is the open-source implementation of Zeroconf, used for automatic management of networks without any centralized configuration. Generally, Avahi is only useful in small local networks (such as a home LAN).

The avahi-daemon process handles mDNS, which is used for name resolution and service discovery within the local network. If you don't need its functions, Avahi can be safely removed.

  • Local name resolution – allows you to reach the computer by a hostname.local name without any centralized configuration. Since your server most likely has a DNS name, this function is unnecessary.

  • Service discovery – allows programs to find and advertise running services (for example, to allow listing all SSH or PulseAudio servers in the LAN). This is convenient on a home network, but entirely useless for a datacenter-hosted server. This too can be safely removed.

(Other Avahi components, which are inactive on your server, are avahi-autoipd for RFC 3927 and avahi-dnsconfd for discovery of unicast-DNS servers.)

user1686

Posted 2011-07-29T15:50:23.250

Reputation: 283 655

1Watch out for dependencies though, apt-get remove avahi-daemon sometimes wants to uninstall Gnome. – basic6 – 2015-05-21T23:08:39.357

Thanks grawity for the great answer. Would you happen to know how I could remove all avahi packages from mt system? Thanks – Mridang Agarwalla – 2011-07-29T23:04:10.083

1

@Mridang: Using apt-get remove.

– user1686 – 2011-07-29T23:36:46.693

1

sudo apt-get purge avahi-daemon

To merely disable:

sudo systemctl stop avahi-daemon
sudo systemctl disable avahi-daemon

Gringo Suave

Posted 2011-07-29T15:50:23.250

Reputation: 932

0

This worked for Linux Mint 13 (based on Ubuntu 12.04)

http://ubuntuforums.org/showthread.php?t=1339516

Edit the /etc/init/avahi-daemon.conf file to something like this: Code:

# avahi-daemon - mDNS/DNS-SD daemon
#
# The Avahi daemon provides mDNS/DNS-SD discovery support (Bonjour/Zeroconf)

# allowing applications to discover services on the network.
description "mDNS/DNS-SD daemon"

start on (never
      and filesystem
  and started dbus)
stop on stopping dbus

Newbie

Posted 2011-07-29T15:50:23.250

Reputation: 1

update-rc.d method does not work on Debian – Eric – 2015-07-10T23:48:39.343

Finally: sudo update-rc.d -f avahi-daemon remove – jnovack – 2013-04-05T13:42:25.683