安裝telnet服務的實驗
1、放光盤,掛載
[root@localhost ~]# mount /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only
進入光盤裏面
[root@localhost ~]# cd /mnt/Server
2、安裝xinetd服務
[root@localhost Server]# rpm -ivh xinetd-2.3.14-10.el5.i386.rpm
warning: xinetd-2.3.14-10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:xinetd ########################################### [100%]
重起xinetd服務
[root@localhost Server]# service xinetd restart
Stopping xinetd: [FAILED]
Starting xinetd: [ OK ]
3、安裝telnet服務
[root@localhost Server]# rpm -ivh telnet-server-0.17-38.el5.i386.rpm
warning: telnet-server-0.17-38.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:telnet-server ########################################### [100%]
4、改xinetd的配置文件
[root@localhost Server]# vim /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
disable = no #######把此處的yes改爲no
重起xinetd服務
[root@localhost Server]# service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
改hosts文件,添加xp的IP,以及主機名(隨便)
[root@localhost Server]# vim /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
172.16.30.20 cpp
用客戶端登錄
查看23號端口,可以看出telnet 的端口號23是 xinetd 開啓的,由此可知xinetd是telnet的超級守護進程
[root@localhost Server]# netstat -nlutp |grep 23
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN 3973/xinetd
udp 0 0 0.0.0.0:723 0.0.0.0:* 1819/rpc.statd
時間提醒實驗
[root@localhost ~]# date
Fri Mar 20 19:45:22 CST 2009
先把date 格式化
[root@localhost ~]# date +%D-%H:%M
03/20/09-19:45
[root@localhost ~]# crontab –e
50 * * * * wall `date`
no crontab for root - using an empty one
crontab: installing new crontab
telnet上的時間報時
終端上的時間報時
Putty上的時間報時
日誌文件實驗
[root@localhost ~]# vim /etc/syslog.conf
把日誌文件的動作域改成/dev/tty,.看是否在終端上輸出
*.info;mail.none;authpriv.none;cron.none /dev/tty3
改完後重起syslog服務
[root@localhost ~]# service syslog restart
Shutting down kernel logger: [ OK ]
Shutting down system logger: [ OK ]
Starting system logger: [ OK ]
Starting kernel logger: [ OK ]