#为删除你系统上的用户,用下面的命令:
[root@c1gstudio]# userdel username
#批量删除方式
#这里删除"adm lp sync shutdown halt mail news uucp operator games gopher ftp "账号
#如果你开着ftp等服务可以把ftp账号保留下来。
for i in adm lp sync shutdown halt mail news uucp ope
rator games gopher ftp ;do userdel $i ;done
2.删除系统特殊的组帐号
[root@c1gstudio]# groupdel groupname
#批量删除方式
for i in adm lp mail news uucp games dip pppusers pop
users slipusers ;do groupdel $i ;done
批量方式先停止服务
for i in acpid anacron apmd atd auditd autofs avahi-daemon avahi-dnsconfd bluetooth cpuspeed cups dhcpd firstboot gpm haldaemon hidd ip6tables ipsec isdn kudzu lpd mcstrans messagebus microcode_ctl netfs nfs nfslock nscd pcscd portmap readahead_early restorecond rpcgssd rpcidmapd rstatd sendmai
l setroubleshoot snmpd sysstat xfs xinetd yppasswdd ypserv yum-updatesd ;do service $i stop;done
关闭启动服务
for i in acpid anacron apmd atd auditd autofs avahi-daemon avahi-dnsconfd bluetooth cpuspeed cups dhcpd firstboot gpm haldaemon hidd ip6tables ipsec isdn kudzu lpd mcstrans messagebus microcode_ctl netfs nfs nfslock nscd pcscd portmap readahead_early restorecond rpcgssd rpcidmapd rstatd sendmai
l setroubleshoot snmpd sysstat xfs xinetd yppasswdd ypserv yum-updatesd ;do chkconfig $i off;done
以下为手动方式及解释,执行批量方式后不需再执行了
chkconfig --level 345 apmd off ##笔记本需要
chkconfig --level 345 netfs off ## nfs客户端
chkconfig --level 345 yppasswdd off ## NIS服务器,此服务漏洞很多
chkconfig --level 345 ypserv off ## NIS服务器,此服务漏洞很多
chkconfig --level 345 dhcpd off ## dhcp服务
chkconfig --level 345 portmap off ##运行rpc(111端口)服务必需
chkconfig --level 345 lpd off ##打印服务
chkconfig --level 345 nfs off ## NFS服务器,漏洞极多
chkconfig --level 345 sendmail off ##邮件服务, 漏洞极多
chkconfig --level 345 snmpd off ## SNMP,远程用户能从中获得许多系统信息
chkconfig --level 345 rstatd off ##避免运行r服务,远程用户可以从中获取很多信息
chkconfig --level 345 atd off ##和cron很相似的定时运行程序的服务
注:以上chkcofig 命令中的3和5是系统启动的类型,以下为数字代表意思
0:开机(请不要切换到此等级)
1:单人使用者模式的文字界面
2:多人使用者模式的文字界面,不具有网络档案系统(NFS)功能
3:多人使用者模式的文字界面,具有网络档案系统(NFS)功能
4:某些发行版的linux使用此等级进入x windows system
5:某些发行版的linux使用此等级进入x windows system
6:重新启动
如果不指定--level 单用on和off开关,系统默认只对运行级3,4,5有效
chkconfig cups off #打印机
chkconfig bluetooth off # 蓝牙
chkconfig hidd off # 蓝牙
chkconfig ip6tables off # ipv6
chkconfig ipsec off # vpn
chkconfig auditd off #用户空间监控程序
chkconfig autofs off #光盘软盘硬盘等自动加载服务
chkconfig avahi-daemon off #主要用于Zero Configuration Networking ,一般没什么用建议关闭
chkconfig avahi-dnsconfd off #主要用于Zero Configuration Networking ,同上,建议关闭
chkconfig cpuspeed off #动态调整CPU频率的进程,在服务器系统中这个进程建议关闭
chkconfig isdn off #isdn
chkconfig kudzu off #硬件自动监测服务
chkconfig nfslock off #NFS文档锁定功能。文档共享支持,无需的能够关了
chkconfig nscd off #负责密码和组的查询,在有NIS服务时需要
chkconfig pcscd off #智能卡支持,,如果没有可以关了
chkconfig yum-updatesd off #yum更新
chkconfig acpid off
chkconfig autofs off
chkconfig firstboot off
chkconfig mcstrans off #selinux
chkconfig microcode_ctl off
chkconfig rpcgssd off
chkconfig rpcidmapd off
chkconfig setroubleshoot off
chkconfig xfs off
chkconfig xinetd off
chkconfig messagebus off
chkconfig gpm off #鼠标
chkconfig restorecond off #selinux
chkconfig haldaemon off
chkconfig sysstat off
chkconfig readahead_early off
chkconfig anacron off
“/etc/host.conf”说明了如何解析地址。编辑“/etc/host.conf”文件(vi /etc/host.conf),加入下面这行:
# Lookup names via DNS first then fall back to /etc/hosts.
order hosts,bind
# We have machines with multiple IP addresses.
multi on
# Check for IP address spoofing.
nospoof on