热门关键字:  PHP  Cisco  seo  网络广告 虚拟主机 中文域名
当前位置 :| 主页>服务器>Linux服务器>

经典文档:Linux网络服务器配置详解

来源:天极网 作者:未知 时间:2005-10-17 点击:

在任何的网络环境中使用Linux系统,第一件要做的事就是了解一下服务器到底要提供哪些服务。不需要的那些服务应该被禁止掉,最好卸载掉,这样黑客就少了一些攻击系统的机会。

  查看“/etc/inetd.conf”文件,了解一下inetd提供哪些服务。用加上注释的方法(在一行的开头加上#号),禁止任何不需要的服务,再给inetd进程发一个SIGHUP信号。

  第一步:把文件的许可权限改成600。

[root@deep]# chmod 600 /etc/inetd.conf

  第二步:确信文件的所有者是root。

[root@deep]# stat /etc/inetd.conf

  第三步:编辑“inetd.conf”文件(vi /etc/inetd.conf),禁止所有不需要的服务,如:ftp、 telnet、 shell、 login、 exec、talk、ntalk、 imap、 pop-2、pop-3、finger、auth,等等。

  如果你觉得某些服务有用,可以不禁止这些服务。但是,把这些服务禁止掉,系统受攻击的可能性就会小很多。改变后的“inetd.conf”文件的内容如下面所示:

# To re-read this file after changes, just do a 'killall -HUP inetd' 

# 

#echo stream tcp nowait root internal 

#echo dgram udp wait root internal 

#discard stream tcp nowait root internal 

#discard dgram udp wait root internal 

#daytime stream tcp nowait root internal 

#daytime dgram udp wait root internal 

#chargen stream tcp nowait root internal 

#chargen dgram udp wait root internal 

#time stream tcp nowait root internal 

#time dgram udp wait root internal 

# 

# These are standard services. 

# 

#ftp stream tcp nowait root

/usr/sbin/tcpd in.ftpd -l -a 

#telnet stream tcp nowait root

/usr/sbin/tcpd in.telnetd 

# 

# Shell, login, exec, comsat and talk are BSD protocols. 

# 

#shell stream tcp nowait root

/usr/sbin/tcpd in.rshd 

#login stream tcp nowait root 

/usr/sbin/tcpd in.rlogind 

#exec stream tcp nowait root 

/usr/sbin/tcpd in.rexecd 

#comsat dgram udp wait root 

/usr/sbin/tcpd in.comsat 

#talk dgram udp wait root 

/usr/sbin/tcpd in.talkd 

#ntalk dgram udp wait root 

/usr/sbin/tcpd in.ntalkd 

#dtalk stream tcp wait nobody 

/usr/sbin/tcpd in.dtalkd 

# 

# Pop and imap mail services et al 

# 

#pop-2 stream tcp nowait root 

/usr/sbin/tcpd ipop2d 

#pop-3 stream tcp nowait root 

/usr/sbin/tcpd ipop3d 

#imap stream tcp nowait root 

/usr/sbin/tcpd imapd 

# 

# The Internet UUCP service. 

# 

#uucp stream tcp nowait uucp 

/usr/sbin/tcpd /usr/lib/uucp/uucico -l 

# 

# Tftp service is provided primarily 

for booting. Most sites 

# run this only on machines acting as

"boot servers." Do not uncomment 

# this unless you *need* it. 

# 

#tftp dgram udp wait root

/usr/sbin/tcpd in.tftpd 

#bootps dgram udp wait root 

/usr/sbin/tcpd bootpd 

# 

# Finger, systat and netstat give out 

user information which may be 

# valuable to potential "system crackers."

Many sites choose to disable 

# some or all of these services to improve security. 

# 

#finger stream tcp nowait root 

/usr/sbin/tcpd in.fingerd 

#cfinger stream tcp nowait root 

/usr/sbin/tcpd in.cfingerd 



  #systat stream tcp nowait guest 

/usr/sbin/tcpd /bin/ps -auwwx 



  #netstat stream tcp nowait guest 

/usr/sbin/tcpd /bin/netstat -f inet 



  # 



  # Authentication 



  # 



  #auth stream tcp nowait nobody

/usr/sbin/in.identd in.identd -l -e -o 



  # 



  # End of inetd.conf
 

最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册
赞助商连接