同样的办法处理internet打印的服务:[root@linux ~]# which cupsd
/usr/sbin/cupsd
[root@linux ~]# rpm -qf /usr/sbin/cupsd
cups-1.1.22-0.rc1.9.27

[root@linux ~]# rpm -qc cups |grep init
/etc/rc.d/init.d/cups

[root@linux ~]# /etc/rc.d/init.d/cups stop
Stopping cups: [ OK ]
[root@linux ~]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      4638/portmap
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      4878/sendmail: acce
tcp        0      0 :::22                       :::*                        LISTEN      4844/sshd但是现在只是关闭这些服务程序,这些程序重启后还会自动起来

二、临时关闭服务方法:

1、        查看服务和端口关联关系:
比如查看ipp服务的关联进程:#lsof |grep ipp

2、        确认服务和端口的关联关系:
序列        端口        服务        路径/etc/init.d        状态
1)        22        ssh         sshd        保留
2)        25        smtp        postfix        关闭
3)        111        rpc        portmap        关闭
4)        427        svrloc        slpd        关闭
5)        631        ipp        cupsd        关闭

3、        手动关闭方法:
停止smtp:/etc/init.d/postfix stop
停止rpc:/etc/init.d/portmap stop
停止svrloc:/etc/init.d/slpd stop
停止ipp:/etc/init.d/cupsd stop

三、        永久关闭方法:

手动关闭以后每次系统启动,服务还会自己启动,需要从启动配置文件永久禁止:
使用chkconfig –-list命令查看现在系统的自动加载服务:(只截取相关的一部分服务)
shelly:/etc/init.d # chkconfig --list |grep on
cron                      0ff 1ff 2n   3n   4ff 5n   6ff
cups                      0ff 1ff 2n   3:on   4:off 5:on   6:off
nfs                       0:off 1:off 2:off 3:on   4:off 5:on   6:off
nfsboot                   0:off 1:off 2:off 3:on   4:off 5:on   6:off
novell-zmd                0:off 1:off 2:off 3:on   4:on   5:on   6:off
nscd                      0:off 1:off 2:off 3:on   4:off 5:on   6:off
portmap                   0:off 1:off 2:off 3:on   4:off 5:on   6:off
postfix                   0:off 1:off 2:off 3:on   4:off 5:on   6:off
powersaved                0:off 1:off 2:on   3:on   4:off 5:on   6:off
random                    0:off 1:off 2:on   3:on   4:off 5:on   6:off
resmgr                    0:off 1:off 2:on   3:on   4:off 5:on   6:off
slpd                      0:off 1:off 2:off 3:on   4:off 5:on   6:off
shelly:/etc/init.d #
关闭方法:
shelly:/etc/init.d # chkconfig -s cups off
shelly:/etc/init.d # chkconfig -s nfs off
shelly:/etc/init.d # chkconfig -s nfsboot off
shelly:/etc/init.d # chkconfig -s portmap off
shelly:/etc/init.d # shelly:/etc/init.d # chkconfig -s postfix off
shelly:/etc/init.d # chkconfig -s slpd off
备注:永久关闭portmap和nfs有关联,必须先关闭nfs和nfsboot进程,否则会有如下报错。