In the ubuntu17.04 environment, using NMAP to scan their own machine, found that 631 port is open, the input into the browser, you can see that the network printer services:
This port is always so dazzling, (5.12 Global outbreak of ransomware virus makes people shudder, the virus takes advantage of the Windows system's 445 port for infection), for security, usually during the learning process, and will not use to the network printer, so decided to close the port.
There is a cups.conf in the script under the/etc/init file that is used at boot, and you can see that there are three lines in it as follows:
1 start On (filesystem2 and (started Dbus or runlevel [2345]))3 stop on RunLevel [016]
We can see what he means when the runlevel is 2345, the service is turned on, and we can check the runlevel of our current environment by runlevel this command.
Here we want the service to be closed under whatever runlevel, and change the above three lines to the following:
1 start On (filesystem2and (started Dbus or RunLevel []))3 stop on RunLevel [0 123456]
Reboot to see if this service is closed, port is not also open!!!
Ubuntu off 631 (cups) port