本文仅供参考学习用。
这一次我们来介绍一下 如何开启linux的服务
一般来说 大家最想开的就是telnet服务!为什么呢?应为方便嘛!
好我们就来说一下linux下的服务如何开!
第一前提是你的服务已经安装!但是没有开! 不要服务都没有装就在那里着个半死啊!
开始了!!
[root@scan root]# setup
他出现了一个表这个表里面有服务啊!网络设置什么的!
───────┤ Choose a Tool ├─────────┐
│ │
│ Authentication configuration │
│ Firewall configuration │
│ Mouse configuration │
│ Network configuration │
│ Printer configuration │
│ System services │
│ Sound card configuration │
│ Timezone configuration │
当然我们介绍服务最关心的还应该是System services好了!我们打开他!
HOHO~~~
┌────────────┤ 服务 ├────────────┐
│ │
│ 您想自动启动哪些服务? │
│ [ ] httpd │
│[*] sshd ▒ │
│[*] syslog ▒ │
│ [ ] talk ▒ │
│ [ ] telnet ▒ │
│ [ ] time ▒ │
│ [ ] time-udp ▒ │
│ [ ] tux #
│ [ ] vncserver ▒ │
│ │
这个只是一个片断而已这里我们就开启httpd那么我们就在他\前面加个*号!
│ │
│ 您想自动启动哪些服务? │
│[*] httpd │
│[*] sshd ▒ │
│[*] syslog ▒ │
│ [ ] talk ▒ │
│ [ ] telnet ▒ │
│ [ ] time ▒ │
│ [ ] time-udp ▒ │
│ [ ] tux #
│ [ ] vncserver ▒ │
│ │
让我们保存退出!HOHO~~~~~~~如果只是这样的话!服务还没有启动!我们要着出对应的服务起动!
我们进/etc/rc.d/init.d
[root@scan root]# cd /etc/rc.d/init.d
[root@scan init.d]# ls
aep1000 bcm5820 dhcrelay innd keytable lisa nfslock portmap rhnsd smb syslog xinetd
amd bgpd firstboot iptables killall mailman nscd postfix ripd snmpd tux ypbind
anacron canna functions irda kprop named ntpd pxe ripngd snmptrapd vncserver yppasswdd
apmd crond gpm isdn krb524 netfs ospf6d radvd saslauthd spamassassin vsftpd ypserv
atd cups halt kadmin krb5kdc network ospfd random sendmail squid winbind ypxfrd
autofs dhcpd httpd kdcrotate kudzu nfs pcmcia rawdevices single sshd xfs zebra
看到没有N多服务阿!当然这个是我自己的电脑
这里的执行程序一般都支持start HOHO~~`
[root@scan init.d]# ./httpd
用法: httpd {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}
好!我现用nmap扫描自己看看哈
[root@scan init.d]# nmap -O 127.0.0.1
Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on scan (127.0.0.1):
(The 1595 ports scanned but not shown below are in state: closed)
Port State Service
22/tcp open ssh
25/tcp open smtp
111/tcp open sunrpc
631/tcp open ipp
783/tcp open hp-alarm-mgr
6000/tcp open X11
Remote operating system guess: Linux Kernel 2.4.0 - 2.5.20
Uptime 0.064 days (since Tue Mar 11 16:52:28 2003)
Nmap run completed -- 1 IP address (1 host up) scanned in 7 seconds
还真没有开80噢!
好!等我启动httpd看看
[root@scan init.d]# ./httpd start
启动 httpd:httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ 确定 ]
[root@scan init.d]# nmap -O 127.0.0.1
Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on scan (127.0.0.1):
(The 1593 ports scanned but not shown below are in state: closed)
Port State Service
22/tcp open ssh
25/tcp open smtp
80/tcp open http
111/tcp open sunrpc
443/tcp open https
631/tcp open ipp
783/tcp open hp-alarm-mgr
6000/tcp open X11
Remote operating system guess: Linux Kernel 2.4.0 - 2.5.20
Uptime 0.065 days (since Tue Mar 11 16:52:27 2003)
Nmap run completed -- 1 IP address (1 host up) scanned in 8 seconds
好!现在可以用127.0.0.1访问自己的叶面了!
HOHO~~~~~~
还有~~~
[root@scan xinetd.d]# more telnet
# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
disable = yes
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}
这里是他的一个服务的可以说是状态!比如说yes哲理就说明服务开始!
如果是no的话!那就是关闭!呵呵 !~~~~一般在/etc/xinetd.d目录下有一些比较重要的服务!
比如说!telnet~~~~~一般把这个disable = yes改注消或者是disable = no
然后起动service xinetd restart
就可以开启对应的服务了!

