大连企业网站哪一家好,网站建设 源代码,大连金州代做网站公众号,工商注册咨询电话24小时人工服务linux下的方法:使用命令netstat -ntlp查找到端口号所对应的进程号#xff0c;然后使用ps -ef查找所对应的具体的进程(名称),然后将该进程kill掉就可以了#xff1b;chkconfig --list----说明一点: solaris下,没有chkconfig命令,netstat也不带netstat -ntlp# uname -aSunOS is…linux下的方法:使用命令netstat -ntlp查找到端口号所对应的进程号然后使用ps -ef查找所对应的具体的进程(名称),然后将该进程kill掉就可以了chkconfig --list----说明一点: solaris下,没有chkconfig命令,netstat也不带netstat -ntlp# uname -aSunOS isd 5.9 Generic_117171-07 sun4u sparc SUNW,Sun-Fire-V240# netstat -ntlpnetstat: illegal option -- tusage: netstat [-anv] [-f address_family]netstat [-g | -p | -s] [-n] [-f address_family] [-P protocol]netstat -mnetstat -i [-I interface] [-an] [-f address_family] [interval]netstat -r [-anv] [-f address_family|filter]netstat -M [-ns] [-f address_family]netstat -D [-I interface] [-f address_family]# chkconfig --listchkconfig: not foundlinux下如何直接关闭某个服务呢?(面试IBM时也被这个问题给问住了,主要是和solaris弄混淆了)1)由xinetd.d控制的,修改/etc/xinetd.d/下对应的文件[rootidns xinetd.d]# pwd/etc/xinetd.dxinetd.d]# ls -rlt×ÜÓÃÁ¿ 128-rw-r--r-- 1 root root 515 2005-02-04 time-udp-rw-r--r-- 1 root root 495 2005-02-04 time-rw-r--r-- 1 root root 508 2005-02-04 tftp-rw-r--r-- 1 root root 303 2005-02-04 telnet-rw-r--r-- 1 root root 406 2005-02-04 sgi_fam-rw-r--r-- 1 root root 312 2005-02-04 services-rw-r--r-- 1 root root 317 2005-02-04 rsync-rw-r--r-- 1 root root 429 2005-02-04 rsh-rw-r--r-- 1 root root 376 2005-02-04 rlogin-rw-r--r-- 1 root root 359 2005-02-04 rexec-rw-r--r-- 1 root root 333 2005-02-04 pop3s-rw-r--r-- 1 root root 266 2005-02-04 ktalk-rw-r--r-- 1 root root 307 2005-02-04 kshell-rw-r--r-- 1 root root 322 2005-02-04 krb5-telnet-rw-r--r-- 1 root root 309 2005-02-04 klogin-rw-r--r-- 1 root root 357 2005-02-04 ipop3-rw-r--r-- 1 root root 451 2005-02-04 ipop2-rw-r--r-- 1 root root 363 2005-02-04 imaps-rw-r--r-- 1 root root 368 2005-02-04 imap-rw-r--r-- 1 root root 325 2005-02-04 gssftp-rw-r--r-- 1 root root 322 2005-02-04 eklogin-rw-r--r-- 1 root root 358 2005-02-04 echo-udp-rw-r--r-- 1 root root 339 2005-02-04 echo-rw-r--r-- 1 root root 353 2005-02-04 dbskkd-cdb-rw-r--r-- 1 root root 437 2005-02-04 daytime-udp-rw-r--r-- 1 root root 417 2005-02-04 daytime-rw-r--r-- 1 root root 239 2005-02-04 cups-lpd-rw-r--r-- 1 root root 580 2005-02-04 chargen-udp-rw-r--r-- 1 root root 560 2005-02-04 chargen-rw-r--r-- 1 root root 230 2005-02-04 amidxtape-rw-r--r-- 1 root root 227 2005-02-04 amandaidx-rw-r--r-- 1 root root 318 2005-02-04 amanda若要启动或关闭上述这些进程,直接修改里面文件的内容sample :打开主机的telnet# telnet 127.0.0.1Trying 127.0.0.1...telnet: Unable to connect to remote host: Connection refused说明telnet未打开![rootidns xinetd.d]# vi telnet# default: on# description: The telnet server serves telnet sessions; it uses# unencrypted username/password pairs for authentication.service telnet{disable no由yes改为noflags REUSEsocket_type streamwait nouser rootserver /usr/sbin/in.telnetdlog_on_failure USERID}保存,退出![rootidns xinetd.d]# ps -ef|grep xineroot 1327 1 0 2005 ? 00:00:00 xinetd -stayalive -pidfile /var/run/xinetd.pidroot 15526 15118 0 13:57 pts/0 00:00:00 grep xine[rootidns xinetd.d]# kill -HUP 1327[rootidns xinetd.d]# telnet 127.0.0.1Trying 127.0.0.1...Connected to idns (127.0.0.1).Escape character is ^].Red Hat Enterprise Linux AS release 3 (Taroon Update 2)Kernel 2.4.21-15.ELsmp on an i686login:证明telnet已打开!2)不由xinet.d控制的进程,就只能手工杀掉并重起(一般脚本在/etc/init.d里)说明一下solaris下如何关闭服务:1)由/etc/inetd.conf控制的服务,将该服务对应的行直接加#再kill –HUP ‘inetd pid ‘即可!2)不由/etc/inetd.conf控制的服务,和linux下基本一样,只能手工杀掉并重起(一般脚本在/etc/init.d里)关于inetd.conf与/etc/services的区别(选自版主)/etc/services只是一个“service_name/protocol port”的对照表而已,inetd.conf是记载下哪些会被加载的服务(未加#)若你把apache的listen端口改为12345那么netstat -lp会看到端口12345在监听.若你在/etc/services里面添加12345端口的说明前面注释为platinum那么netstat -lp就会变为platinum服务了.若用iptables做针对port的DROP的话iptables -vL也会看到同样的效果这是在/etc/nsswitch.conf里面定义的service的解析使用files这个功能隶属于/lib/libnss_files.so.1和/lib/libnss_files.so.2关于/etc/services有很多人有误解以为删了/添了一行数据就可以关掉/开启某个服务这是错误的概念我这里说一下.#grep 8080 /etc/serviceswebcache 8080/tcp # WWW caching servicewebcache 8080/udp # WWW caching service