辅导:巧用Linux架设TFTPServer备份路由器的配置文件
来源:优易学  2011-9-30 12:37:00   【优易学:中国教育考试门户网】   资料下载   IT书店

  TFTP (普通文件传输协议或一般文件传输协议) 大家一定记得在2003年8月12日全球爆发冲击波(Worm.Blaster)病毒,这种病毒会监听端口69,模拟出一个TFTP服务器,并启动一个攻击传播线程,不断地随机生成攻击地址,进行入侵。另外tftp被认为是一种不安全的协议而将其关闭,同时也是防火墙打击的对象,这也是有道理的。不过tftp还是有用武之地的,下面讲的文件传输和备份router配置文件都时实际应用,它也只时一种手段而已。
  一、用TFTP实现文件传输
  
环境:服务器A :rhas11
  客户机B: rhas101
  首先用rpm –qa | grep tftp看一下tftp有没安装,没有的话安装一下。
  A:在服务器端设置
  #vi /etc/xinetd.d/tftp
  service tftp
  {
  disable no
  socket_type dgram
  protocol udp
  wait yes
  user root
  server /usr/sbin/in.tftpd
  server_args -s /test
  per_source 11
  cps 100 2
  flags IPv4
  }
  或用chkconfig tftp on 也可以打开xinetd代理的tftp服
  #mkdir /test
  #service xinetd restart 从启xinetd服务,因为TFTP服务受控与xinetd, xinetd是管服务的服务,它是不开端口的。
  验证一下TFTP是否起来了:
  [root@rhas11 tftp]# netstat -nlp
  Active Internet connections (only servers)
  Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
  tcp 0 0 0.0.0.0:32768 0.0.0.0:* LISTEN 3122/rpc.statd
  tcp 0 0 127.0.0.1:32781 0.0.0.0:* LISTEN 4035/xinetd
  tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 3103/portmap
  tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3324/httpd
  tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3255/sshd
  tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3213/cupsd
  tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3295/sendmail: acce
  tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 3415/0
  tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 3324/httpd
  udp 0 0 0.0.0.0:32768 0.0.0.0:* 3122/rpc.statd
  udp 0 0 0.0.0.0:69 0.0.0.0:* 4035/xinetd
  udp 0 0 0.0.0.0:69 0.0.0.0:* 4012/in.tftpd
  udp 0 0 0.0.0.0:111 0.0.0.0:* 3103/portmap
  udp 0 0 0.0.0.0:754 0.0.0.0:* 3122/rpc.statd
  udp 0 0 0.0.0.0:631 0.0.0.0:* 3213/cupsd
  A:服务器端
  新建一文件file
  #cd /test
  [root@rhas11 test]# ls -l
  总用量 4
  -rw-r--r-- 1 root root 19 5月 15 18:26 file
  B客户端:
  下载:
  [root@rhas101 tmp]# tftp 172.31.0.11
  tftp> get 1
  Received 72 bytes in 0.0 seconds
  tftp>
  上传当前目录下文件”aaa”
  [root@rhas101 client]# ls -l
  总用量 4
  -rw-r--r-- 1 root root 15 5月 20 21:49 aaa
  [root@rhas101 client]# tftp 172.31.0.11
  tftp> put aaa
  Error code 1: File not found
  tftp>

[1] [2] 下一页

责任编辑:小草

文章搜索:
 相关文章
热点资讯
热门课程培训