安装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 �Ce
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 ]