To kill off login from the kernel serial console as well as any other serial devices, remove or comment with a leading '#' any lines that invoke the getty process from /etc/inittab. Ubuntu doesn't by default enable serial console or serial port login capability however if you have added this it may have been done by adding an /etc/init/nf that you can alter or remove.Flashing routers with custom firmware if fun.
Especially a firmware compiled by yourself.