jeudi 17 avril 2008

Disabling Samba and Portmap on EeePC

Today I joined the EeePC frenzy. After playing a while with it I found that there are too many opened ports on this little thing, and I HATE having opened ports when I don't use the given service:
  • netstat -tul

My suspicions were right - after searching a while on the net I found that the version of Samba shipped with the EeePC has some security flaws (see here for a quick fix). 

After fixing the flaw I wanted to stop Samba and Portmap, but it turned out to be a tricky business. No matter what I tried, they always came up after a reboot (removed all scripts from /etc/rc*d from both the system and the user partitions, etc.). Finally I was really pissed of from the damned things showing up, so I did a quick:
  • sudo chmod a-x /etc/init.d/samba
  • sudo chmod a-x /etc/init.d/portmap
  • sudo chmod a-x /sbin/portmap
  • Reboot
and the problems went away (note that stopping the inet.d/portmap script alone did not prevent portmap from running). Now I can start and stop the service only when I need it with:
  • sudo sh /etc/init.d/samba start
and
  • sudo sh /etc/init.d/samba stop

I don't understand who and why starts the services (possibly because I've never actually used Xandros) so I'd really appreciate it if someone could give a better solution to this problem.